|
Hi!!
I am running an application which is developed in VS2 Beta version in VS2.. Everything is fine except Reports.. When i run reports i am getting an error like "Failed to load database information. Details: The database DLL 'crdb_fielddef.dll' could not be loaded. Error in File C:\DOCUME~1\USHA~1.SNI\LOCALS~1\Temp\registrations {A2A0D120-17C0-49B3-A8AD-8F27D24A9C59}.rpt: Failed to load database information."
I am using 'ttx' files to generate Report.. If i dont use 'ttx' file its working fine.. please tel me the solution for my problem?
|
|
|
|
|
Hi,
I am trying to achive the following. Have a loop which goes through a list of suppliers for each supplier a report is created to show their orders (but the report does not need to be displayed on the screen) the report is then rendered into a pdf and emailed to the supplier.
This is what i have done. I have created a local report using the wizard. Created the data set then created the data source for the reportviewer control as an objectdatasource. Placed a loop inside the page load. Inside the loop i have set the paramerter for the objectdatasource to the name of the supplier.
Now if i dont use a loop and just display the report it will display correctly for the supplier that i set in the code and if i place the code to render to pdf and email inside a button it all works fine.
But i need to make it all automatic so on my page load i created a loop that first sets the supplier paramerter then calls the function to render to pdf and then email the report. But it gives an error when i try to render the report saying that the datasource for the report has not been set. I tried the code from the net that resets the reports clears it out of the page collection then creates a new reportviewer control and assign it the dataset but it does not work. I am thinking that because i am not displaying the report and trying to render it to pdf before it can get the date it is giving an error. I am pasting the code that i have tried any ideas ???
Me.ApplianceFax.Reset()
Dim oldViewer As Microsoft.Reporting.WebForms.ReportViewer
Dim oldIndex As New Int32
oldViewer = Me.ApplianceFax
Dim coll As New ControlCollection(Me)
coll = oldViewer.Parent.Controls
oldIndex = coll.IndexOf(oldViewer)
Dim ReportViewer1 As New Microsoft.Reporting.WebForms.ReportViewer
' Set Processing Mode
ReportViewer1.LocalReport.ReportPath = "Report2.rdlc"
ReportViewer1.ProcessingMode = ProcessingMode.Local
' Set reportviewer size
ReportViewer1.Height = New Unit("550px")
ReportViewer1.Width = New Unit("100%")
'ReportViewer1.ID = "ApplianceFax"
' Set default values
ReportViewer1.ShowExportControls = False
ReportViewer1.ShowBackButton = False
ReportViewer1.SizeToReportContent = True
' Reset the control collection position
coll.AddAt(oldIndex, ApplianceFax)
coll.Remove(oldViewer)
Me.ObjectDataSource1.SelectParameters("Supplier").DefaultValue = Supplier
ReportViewer1.LocalReport.DataSources.Clear()
ReportViewer1.LocalReport.DataSources.Add(New Microsoft.Reporting.WebForms.ReportDataSource("dsApplianceFaxTableAdapters.sp_ApplianceFaxReportTableAdapter", Me.ObjectDataSource1))
ReportViewer1.LocalReport.Refresh()
|
|
|
|
|
Reportviewer's dont use the new report source unless the page gets refreshed.
So if you want it to run into a loop it had to be response.redirected to the same page to create the next report.
I was born dumb!!
Programming made me laugh !!!
--sid--
|
|
|
|
|
I 'm from China,my English is not perfect.
my question is:
how to export data to popwerpoint using vs2005 with c#?
thanks
modified on Wednesday, March 19, 2008 10:34 PM
|
|
|
|
|
You cannot export it to powerpoint.
Supported export types are "PDF","Image","Excel".
If you want it in powerpoint save it to image, open a powerpoint presentation and den save the image onto the ppt.
I was born dumb!!
Programming made me laugh !!!
--sid--
|
|
|
|
|
Hi,
I hope someone can help with with my problem, i have searched the Internet for information but i couldnt find any examples neither the answear.
I use NHibernate and c# for my asp.net site.
I have the "classic" problem. I have a dropdownlist with "Regions" and another one "Municipalities".
When I choose an item in the ddlRegions the appropiate municipalites should be shown in ddlMunicipalties. I cant get this to work, do anyone have a code that does this and could share it with me?
I have tried for a few evenings but i cant get it to work.
Thanks
Thommie
|
|
|
|
|
Hi Thommie,
I think your looking for somting like this:
private void ddlRegions_SelectedIndexChanged(object sender, System.EventArgs e)
{
RetrieveMunicipalities( int.Parse( ddlRegions.SelectedValue ) );
}
private void RetrieveMunicipalities( int region)
{
ddlMunicipalities.DataSource = Retrieve_Municipalities( region);
ddlMunicipalities.DataBind();
}
Greetins,
Marco van der Linden
|
|
|
|
|
Hi Marco,
Whats "= Retrieve_Municipalities( region)"?
is that a method to bind the data from the database?
can you please show me?
Thanks for the answear
Thommie
|
|
|
|
|
Hi Thommie,
Its a method that retrieve data from the database.
public DataTable Retrieve_Municipalities( int region)
{
string connectieString = ConfigurationSettings.AppSettings["ConnectieString"];
SqlConnection connectie = new SqlConnection(connectieString);
SqlCommand commando = new SqlCommand("spRetrieveMunicipalities", connectie);
SqlDataAdapter adapter = new SqlDataAdapter(commando);
commando.CommandType = CommandType.StoredProcedure;
SqlParameter parameterHoofdgroep = new SqlParameter("@region", SqlDbType.Int);
parameterregion.Value = region;
commando.Parameters.Add(parameterregion);
DataTable regions= new DataTable();
adapter.Fill(regions);
connectie.Close();
return regions;
}
Greetings,
Marco
|
|
|
|
|
Hi,
My code looks like this and it doesnt work:
This is with NHibernate.
The error code : fetchQ.ParamName = "Region.Id";
The error text: NHibernate.QueryException: Type mismatch in NHibernate.Expression.EqExpression: Region.Id expected type System.Int32, actual type System.String
RegionId in database is int. And the hbm file is mapped Int32
private void BindMunicipalities(int regionId)<br />
{<br />
try<br />
{<br />
<br />
string municipalityHql = "SELECT count(municipality.Id) from Municipality municipality WHERE municipality.Region.Id = :regionId";<br />
<br />
IList<query> queries = new List<query>();<br />
Query q = new Query();<br />
q.ParamInt = regionId;<br />
q.ParamName = "regionId";<br />
queries.Add(q);<br />
<br />
int municipalityCount = DataManagement.CoreRepository.RunCountStatement(municipalityHql, queries);<br />
<br />
if (municipalityCount > 0)<br />
{<br />
<br />
IList<query> fetchQueries = new List<query>();<br />
Query fetchQ = new Query();<br />
fetchQ.ParamName = "region.Id";<br />
fetchQ.ParamInt = regionId;<br />
fetchQ.ParamEvaluationType = EvaluationType.Equals;<br />
fetchQ.ParamString = string.Empty;<br />
fetchQueries.Add(fetchQ);<br />
<br />
IList<municipality> municipalities = DataManagement.CoreRepository.GetAll<municipality>(fetchQueries, 0, 0, true, "Name");<br />
ddlMunicipality.DataValueField = "Id";<br />
ddlMunicipality.DataTextField = "Name";<br />
ddlMunicipality.DataSource = municipalities;<br />
ddlMunicipality.DataBind();<br />
}<br />
}<br />
<br />
catch (Exception ex)<br />
{<br />
logger.Error("Failed to load municipalities.", ex);<br />
this.lblError.Visible = true;<br />
}<br />
<br />
}<br />
<br />
<br />
protected void ddlRegions_SelectedIndexChanged(object sender, EventArgs e)<br />
{<br />
<br />
this.BindMunicipalities(int.Parse(this.ddlRegions.SelectedValue));<br />
<br />
} <br />
</municipality></municipality></query></query></query></query>
modified on Thursday, March 20, 2008 5:16 PM
|
|
|
|
|
Is it possible to get the data out of a row before it is deleted in the gridview ?? I have implemented Gridview_RowDeleting event handler because I before this event fires before the actual delete occurs. I used the e.RowIndex where is e the GridviewDeleteEventArgs parameter of the function, and RowIndex is the row to be deleted.
however when i do a Gridview1.rows(e.rowindex).cells(1).text ... there is nothing in there. Yes there is data in the table. Same thing then i do cells(2) 0r cells(3). There are 19 columns in table.
Any suggestions on how i can get data pre - delete ?
|
|
|
|
|
Just in case anyone was wondering .... i solved my issue of getting the data out of a row about to be deleted.
Implement the RowDeleting event handler. Use the e.rowIndex where 'e' is the GridViewDeleteEventArgs parameter to the event handler, and 'rowindex' is the index of the row to be deleted. I passed e.rowindex to the gridiew.rows() collection with returns a GridViewRow object. My gridview uses templated fields.
Using that object, call findcontrol passing in the id of the control in the row that you want to find. In my case it was a Label control. Then you will be able to grad whatever data you need out of that control
Protected Sub GridView1_Rowdeleting(ByVal sender as Object,ByVal e as System.Web.UI.WebControls.GridviewDeleteEventArgs ) Handles GridView1.RowDeleting
Dim lblName as Label = CTYPE(Gridview1.Rows(e.RowIndex).FindControl("Label1"),Label)
Dim name as String = lblName.Text
End Sub
|
|
|
|
|
Hi I’m developing an internet ASP.NET application, which needs to interact with Microsoft Certification Authority Server, the
client (browser) will request a certificate to sign a file (word, pdf) later.
I'm really disoriented. Must I use CAPICOM? Signing in the server, and sending the certificate through an SSL connection? Is
there any class in the .Net Framework to interact with Certification Authority Service without CAPICOM or an external Api?
Where can i get a code example?
Regards
Sergio
|
|
|
|
|
Don't cross post. Read the forum rules.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hey all,
I've refactoring a site of mine from VB.Net to C# and using a more structured OO design. I have the main solution with the web project and then another project for the BLL and DAL. I'm creating a additional security class in the BLL and I want to be able to access the context of the user but I'm having a bit of a brain freeze. I know it's the HTTPContext.Context.User class but how do I inherit the this in the BLL function I've created? I've tried HTTPContext.Context but then User is not available.
Any help provided would be greatly appreciated!
Thanks,
Adrian
|
|
|
|
|
Does this work:
HttpContext.Current.User.Identity.Name
Alexei Rodriguez
|
|
|
|
|
No, I did think that would be how I could access it from the BLL but it's not available for some reason.
Thanks for the suggestion though. Any other ideas?
Thanks,
|
|
|
|
|
I found the problem, basically I'm using a different project for my Business Logic so needed to import the System.Web assembly into the class to access the Httpcontext class. It's actually bad practice to use the httpcontext I guess as it then requires a web front end but in my case I'm going to use it anyway.
Regards,
Adrian
|
|
|
|
|
I need to display four GridViews at once, but the data they contain differs in each grid by one parameter. It seems clumsy to add four identical SqlDataSource controls, so is there some way I can re-use one?
|
|
|
|
|
you can use stored procedure and bind one sqldatasource to that stored procedure. you can write down all the four queries with different parameters into your stored procedure using if loop instead of using four sqldatasources.
for that you have to add one more parameter for identify the query from the loop.
for example:
@count int,
@a varchar(50),
@b varchar(50),
@c varchar(50),
@d varchar(50)
if(@count=1)
begin
Query1 with parameter @a
end
if(@count=2)
begin
Query2 with parameter @b
end
if (@count=3)
begin
Query3 with parameter @c
end
if (@count=4)
begin
Query4 with parameter @d
end
|
|
|
|
|
I am developing a system using asp.net 2.0. I have the application on a production server. I have made changes to the app. in my development environment and the changes work fine but when I transfer the changed app to my production environment the changes will not work. It is like the old suystem has been cached. I am hosting production on IIS 5.0 W2K server. I have even deleted the old app of the server and rebooted the server but it appears to still pick up the old application with no changes.
Anyone any ideas how to fix this?
macca
|
|
|
|
|
You cannot be deploying it properly, if you rebooted the server, IIS is restarting and there's nowhere for it to cache, you're just not deploying it properly. You must be deleting/changing the wrong folder.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Do you control the web-server? Could the site be being cached by a content acceleration server? If you re-name the folder on the website and can still hit the website then there is something wrong .
I would double check IIS to make sure it's pointing at the right location. If it is, then create a test HTML page in the root and try to access if from the site. If you can see it you know the website is working. Then update that file and see if you can see the updates. If you can then I agree, it must be something you're doing with the release of the new code.
Thanks,
Adrian
|
|
|
|
|
Hello,
I have a ASP.NET web form that I wanting to display data from a database. Right now I am using the gridview. Is this good to use for future maintenance? or is there a better method to use in order to work with database updates. Would it be better to add a 'table' to the web form and somehow connect it to the database? Do any stored procedures need to be created?
Non-sarcastic answers please Suggestions/ideas are very much appreciated. Thanks!
using C#
MS Server 2003
databasename: UserRequestDatabase
|
|
|
|
|