locked
No printing RDLC file: Designing it in the dark RRS feed

  • Question

  • The "Print..." is grayed out so that I don't know how the design will appear on paper. Is there a work-around?


    VP

    Monday, October 13, 2014 1:34 PM

Answers

  • Many articles suggest that in order to print a report you should generate it based on some data. This can be done with ReportViewer control, which can be dragged from Toolbox to one of your forms or to a new form (maybe test one). Then you associate the control with RDLC file and choose the data source for your report. When you start the application and display the form, it will contain a button for printing the generated report.

    It is also possible to generate and print a report without ReportViewer, from console applications, for example: http://msdn.microsoft.com/en-us/library/ms252091(v=vs.100).aspx.

    • Proposed as answer by Amanda Zhu Monday, October 20, 2014 1:49 AM
    • Marked as answer by Amanda Zhu Tuesday, October 21, 2014 8:27 AM
    Monday, October 13, 2014 4:51 PM
  • [...]

    I just want to click "Print..." select my printer and print it... just the template. [...]


    If you need just some drafts of you report definition without data, then maybe switch to full screen and print some screenshots.


    Thursday, October 16, 2014 6:03 AM

All replies

  • Many articles suggest that in order to print a report you should generate it based on some data. This can be done with ReportViewer control, which can be dragged from Toolbox to one of your forms or to a new form (maybe test one). Then you associate the control with RDLC file and choose the data source for your report. When you start the application and display the form, it will contain a button for printing the generated report.

    It is also possible to generate and print a report without ReportViewer, from console applications, for example: http://msdn.microsoft.com/en-us/library/ms252091(v=vs.100).aspx.

    • Proposed as answer by Amanda Zhu Monday, October 20, 2014 1:49 AM
    • Marked as answer by Amanda Zhu Tuesday, October 21, 2014 8:27 AM
    Monday, October 13, 2014 4:51 PM
  • So it looks like the only way to print it is to write Print() code and to provide instance data and creating a new project. These forms have extensive lists of dependencies and it's too much trouble creating a new project. It's too "destructive" modifying this project. It already prints to a document server.

    I just want to click "Print..." select my printer and print it... just the template. I inherited this code and I need to modify the appearance.

    I'm prefectly fine printing things like

        Gross Pay: [First(GrossAmount)] [First(GrossYTD)]

    <<Expr>> <<Expr>> [Etc] [Etc].

    Is this possible?


    VP

    Monday, October 13, 2014 7:08 PM
  • Hi VP,

    You can’t use Print feature in VS directly for your scenario. Viorel_ provided you some good ways to use Print feature to print your data.

    If you want to write print code to print your data, it is out of support range of VS General Question forum which mainly discusses the usage of Visual Studio IDE such as WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System and Visual Studio Editor.

    I suggest consulting on the development forums based on the programming language. Visual Studio Language Forums may help you: http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?category=vslanguages

    Best regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, October 15, 2014 5:40 AM
  • So by writing code, I have to run it to print it, right?

    (Hint, I don't want to write print code. Code is already written.)


    VP


    Wednesday, October 15, 2014 2:51 PM
  • Hi Violoncello,

    Yes, I think you need run your code to print. I recommend that you use Viroel's suggestion to print your data.

    Best regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, October 16, 2014 1:54 AM
  • [...]

    I just want to click "Print..." select my printer and print it... just the template. [...]


    If you need just some drafts of you report definition without data, then maybe switch to full screen and print some screenshots.


    Thursday, October 16, 2014 6:03 AM
  • I'm aware of the solutions to writing code in order to print an RDLC file. It was not the kind of solution I was looking for. I can print this to the OnBase system and obtain the document. So it's not the vote that I would cast here. The work-around I went with (albeit not a good one), was the screenshot and DPI handling to approximate the size compatible with past printings.

    I have learned and come to accept that sometimes you have to take work-arounds, even if the results are not so great. But.. it's more about limited time/budget than limited capability.

    Thanks anyways for the suggestions.


    VP

    Tuesday, October 21, 2014 3:33 PM
  • I was afraid it would come to that.... but I'll take what I can get. Thanks.


    VP

    Tuesday, October 21, 2014 3:35 PM