none
Visual Basic 2010 -- How to autoprint a report (RDLC) RRS feed

  • Question

  • Hi,

     I would like to have some of our repors to be autorpint instead of user having to click in the report toolbar. I been doing some research lately but it's so confuse I finally found a link from microsoft http://msdn.microsoft.com/en-us/library/ms252091.aspx this link contains a good example for autoprint I tried and it worked. It could work with any report that does not have any paramaters. So, I would like to know how to have an option for autoprint a report with paramaters.

    I believe the problem resides on how to pass the dataset values to the report. Based on microsoft example their report is expecting it from XML file, but how do we do it from the dataset that the report is currently using?

    This is currently how I am doing:

    Me.CustomerLetterDataTableAdapter.FillByCard(Me.Teraco_PersoDataSet.CustomerLetterData, Card.ToString)

    Me.ReportViewer1.RefreshReport()

    Any help would be appreciated. Also, would be great if Microsoft in future releases make it simple for autoprint from reporting services it's maybe an option built in the report that would allow to change a flag/otion for autoprint.

    Thanks

    • Moved by Youen Zen Tuesday, October 16, 2012 8:02 AM To provide better support (From:Visual Basic General)
    Monday, October 15, 2012 6:37 PM

All replies

  • I added the code from microsoft link http://msdn.microsoft.com/en-us/library/ms252091.aspx to my project but I need to find out how to pass the dataset to the report. At the time I am doing it by using this line 

    dim report as new localreport()

    report.reportpath="c:\...\CustomerLetter.rdlc"

    me.customerletterdatatableadapter.fillbycard(datatable,parameter)

    export(report)

    print()

    I am getting no streams and I almost sure I am not passing the values properly so how do I pass the values to the report.

    This report only uses 6 fields let's call them Field1..Field6 and uses a parameter for customer number.

    If someone know how to help me would be appreciated and I would post the solution to others. It seems like there are a plently of developers looking for it

    Monday, October 15, 2012 8:49 PM
  • Hi Rasecsan100,

    Thanks for your post. We have a forum Visual Studio Report Controls that discuss report control. In order to provide better support, I will move this thread.

    Best regards,


    Shanks Zen
    MSDN Community Support | Feedback to us

    Tuesday, October 16, 2012 8:00 AM