none
Report managing pages and using same parameters in more than one page RRS feed

  • Question

  • Hi dear friends! I have been looking in the web for solutions and havent find nothing in reports i this is the best forum.

    What i want to do I think this is the best way (using reports) I have a windows application using VS2005 with Report.rdlc

    What i want to do is read data from a csv file and put that data that in a page creating things like cards!
    I can do that but using textbox´s getting the data from my file and using parameters!The problem is that Parameters are defined in a manual "click way", i read from file one page but after that I simply don't know how to add more pages to report to put all the data from my csv file.

    I am going to post here some pictures to help you visualize.
    And put here the code that i use to define the parameters.

    Hope can Help me.

    Thank you!

    1 private void showPages() 
    2         { 
    3             this.reportViewer1.SuspendLayout(); 
    4               
    5             this.setReport("Container.Report1.rdlc");  
    6             this.reportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local;  
    7             ReportParameter c0 = new ReportParameter("Report_Parameter_0"this.cardsToPrint.Words[1].ChineseTranslation);              
    8             ReportParameter c1 = new ReportParameter("Report_Parameter_1"this.cardsToPrint.Words[2].ChineseTranslation); 
    9             ReportParameter c2 = new ReportParameter("Report_Parameter_2"this.cardsToPrint.Words[3].ChineseTranslation); 
    10             ReportParameter c3 = new ReportParameter("Report_Parameter_3"this.cardsToPrint.Words[4].ChineseTranslation); 
    11             ReportParameter c4 = new ReportParameter("Report_Parameter_4"this.cardsToPrint.Words[5].ChineseTranslation); 
    12             ReportParameter c5 = new ReportParameter("Report_Parameter_5"this.cardsToPrint.Words[6].ChineseTranslation); 
    13             ReportParameter c6 = new ReportParameter("Report_Parameter_6"this.cardsToPrint.Words[7].ChineseTranslation); 
    14             ReportParameter c7 = new ReportParameter("Report_Parameter_7"this.cardsToPrint.Words[8].ChineseTranslation); 
    15             ReportParameter c8 = new ReportParameter("Report_Parameter_8"this.cardsToPrint.Words[9].ChineseTranslation); 
    16             ReportParameter c9 = new ReportParameter("Report_Parameter_9"this.cardsToPrint.Words[10].ChineseTranslation); 
    17             ReportParameter c10 = new ReportParameter("Report_Parameter_10"this.cardsToPrint.Words[11].ChineseTranslation); 
    18             ReportParameter c11 = new ReportParameter("Report_Parameter_11"this.cardsToPrint.Words[12].ChineseTranslation); 
    19  
    20             this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { c0 }); 
    21             this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { c1 });  
    22             this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { c2 }); 
    23             this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { c3 }); 
    24             this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { c4 }); 
    25             this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { c5 }); 
    26             this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { c6 }); 
    27             this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { c7 }); 
    28             this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { c8 }); 
    29             this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { c9 }); 
    30             this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { c10 }); 
    31             this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { c11 }); 
    32              
    33             this.reportViewer1.ResumeLayout();         
    34             
    35             this.reportViewer1.RefreshReport(); 
    36         } 
    Wednesday, October 29, 2008 12:22 AM

All replies

  • Hi N_Garcia,

    I would suggest you use the table control in the rdlc file instead of parameters.

    Here is one way you can do it:

    Create an ODBC connection to your CSV file. Control Panel\Administrative tools\Data sources
    From within your project, build a table using the table adaptor to the ODBC file and the CSV data as part of your project. (I use the Server Explorer. Add New\Change\ODBC Data Source\Select your ODBC specification)
    From the Report Control smart tag, select to add a new report.
    On the report, drop a table from the toolbox.
    From the available data sources in the Server explorer, you should see the ODBC connection and files.
    Drop the fields into your table.

    Brad Syputa, Microsoft Reporting Services This posting is provided "AS IS" with no warranties.
    Thursday, October 30, 2008 5:41 PM
  • Thank you for your reply!

    I have already testeing using tables!With tables automaticly add more pages as need!
    But with a Table i cant make a layout like that!
    I have already tried and cant do it? You have any sugestion?
    Because tables have rows and columns i cant put them like cards :S

    Maybe you can give me an ideia!Put the CSV data into tables i think i can do that case i have already an example doing that.

    I think i dont know how to solve this problem, looks like i have to ask user to print only one page at time :S and that what i can make that card style output and use parameters because is only one page.

    Best Regards

    Hope have more sugestions from you soon. =)
    Friday, October 31, 2008 2:53 PM