Dear friends,
I am currently working on window form application in vs. 2008 I am using Microsoft reporting service for generating reports. I have typed dataset in my application in which there are 195 data table with table adopter and each table adopter have a method to fill data table.
I am using single form(say Viewer) with single report viewer(say reportViewer1) to view all the reports, for this i have create public method for each report. The code from one of the method is as follows
public void LoadSomething(int SomePrimaryKey, string someremark)
{
SomeTableAdapter tb = new SomeTableAdapter();
ReportDataSource rdc = new ReportDataSource(SomeDataSet.DataSetName,SomeDataSet.SomeDataTable);
reportViewer1.LocalReport.DataSources.Add(rdc);
this.reportViewer1.LocalReport.ReportEmbeddedResource = "SomeProject.Reports.SomeReport.rdlc";
rpp.Name = "SomeRemark";
rpp.Values.Add(someRemark);
rpp.Visible = true;
IList<ReportParameter> rpList = new List<ReportParameter>();
rpList.Add(rpp);
reportViewer1.RefreshReport();
}
In client code I am initializing the form viewer then calling the method LoadSomething and Finally call the ShowDailog()
The code compiled well but the problem arises when I load the client form and click the button to generate report first time. The viewer show up with blank report, however if i change the parameter (somePrimaryKey) the report worked fine and display all the fields.
I don't understand why its show up with blank report on first click but after changing the parameter it displays.
I check the Tables.Count property it exactly 195.
In all the 195 reports same problem arise.
and i have preview the data with parameters for checking errors in my sql and it preview as it expected.
Thanks in Advance
Vinod
vinod patidarPosted May 17, 2011, 6:40 AM
ya i can do it in my own way however i just want to know the best possible way to do it.if you can draw some rough sketch of situation plz suggest me.
Thanks
Vinod
Sam HobbsPosted May 13, 2011, 7:46 PM
How many reports are there? In otehr words, how many rdlc file are there in your project?
How do you want the application to work? In other words, what is the ideal? It might not be possible to do it that way easily, but it is probably possible and it sure would be best to attempt to do it the way you really want to do it if you can.
vinod patidarPosted May 13, 2011, 6:21 AM
my problem not solved yet i had checked the data type i have not seen any problem there...
One more thing i sholud ask about, is that any other way i can do the above mention work,i mean for new report i have to create new dataTable with table adopter and new mwthod that is surly not good for maintaince purpose .
can any one suggest something like supplying sql string as paramenter in single method for all report.
Thanks Guys for your support
Vinod
Sam HobbsPosted May 12, 2011, 3:21 PM
I might be able to help but if so then it will take time for me to refer to what we did previously, so I don't want to do that if the problem is solved.
Suthish NairPosted May 12, 2011, 1:36 PM