开发者

Start by displaying print-layout in VS10 Report Designer when running the form

开发者 https://www.devze.com 2023-04-03 06:14 出处:网络
When I run my report from VS10, I have to switch everytime to print-layout. Because I need to make 100+ small adjustment to my big table, I have to press the print-layout button everytime to see the r

When I run my report from VS10, I have to switch everytime to print-layout. Because I need to make 100+ small adjustment to my big table, I have to press the print-layout button everytime to see the result.

Is 开发者_开发技巧there a way, I can set it up, so I start by seeing the print-layout when running the form?


It´s an old post but found the exact answer. Setting Print-Layout instead of setting Zoom mode for the ReportViewer.

ReportViewer1.SetDisplayMode(DisplayMode.PrintLayout)


It looks like you can adjust report viewer properties. I found a adjustment that sets the zoom, in your case (print layout = whole page) so the default would need to be changed.

Here is the VB script for it from MS.

 'Declaration

 <CategoryAttribute("Appearance")> _
 <DefaultValueAttribute(ZoomMode.Percent)> _
 Public Property ZoomMode As ZoomMode

 'Usage

 Dim instance As ReportViewer
 Dim value As ZoomMode

 value = instance.ZoomMode

 instance.ZoomMode = value

I don't know if you have to use a # like value = 50 or if you can use value = Whole Page, it seems like the latter can be used since it bases the figures dimensions on the logical page to assume the view size.

Goood luck and check http://msdn.microsoft.com/en-us/library/microsoft.reporting.winforms.reportviewer.zoommode.aspx for further guidance and different code options.

0

精彩评论

暂无评论...
验证码 换一张
取 消