在横向打印报表查看器 [英] To print a reportviewer in landscape
问题描述
大家好,我正试图在横向打印报告,我不知道从哪里开始。这就是我到目前为止接触它的方法 Dim
Hi everyone, I am trying to have a report print in landscape and i do not know where to start. This is how i have approached it so far Dim
ds = GetActivitySheet()这是对我的函数的调用,用于填充数据集
ds = GetActivitySheet() This is a call to my function that fills the dataset
ReportViewer1.ProcessingMode = ProcessingMode.Local
ReportViewer1.ProcessingMode = ProcessingMode.Local
Dim rep1 As LocalReport = ReportViewer1.LocalReport
Dim rep1 As LocalReport = ReportViewer1.LocalReport
rep1.ReportPath = Server.MapPath( "Reports\UniformrptActivitySheet.rdlc" )
rep1.ReportPath = Server.MapPath("Reports\UniformrptActivitySheet.rdlc")
Dim dsActSheet As New ReportDataSource
Dim dsActSheet As New ReportDataSource
dsActSheet.Name = & quot; ActivitySheet_dtActSheet"
dsActSheet.Name = "ActivitySheet_dtActSheet"
dsActSheet.Value = ds.Tables(0)
dsActSheet.Value = ds.Tables(0)
rep1.DataSources.Clear()
rep1.DataSources.Clear()
rep1.DataSources.Add(dsActSheet)
rep1.DataSources.Add(dsActSheet)
rep1.Refresh()
rep1.Refresh()
dsActSheet = Nothing
dsActSheet = Nothing
ds = 没什么
我的数据集来自和SQL表。有人可以帮忙。
推荐答案
这实际上很简单,你不需要代码去做吧。 (你可以,我想)
你需要进入rdlc页面属性并将PageSize设置为Width:11in,Height:8.5in或者景观报告需要的任何测量值。
这在VS中的记录非常糟糕。
如果您需要让用户在Landscape和Portrait之间切换,我找到的唯一方法是创建两个单独的报告,但如果它是一个非常简单的报告,您可以在运行时生成代码。 br>
希望有所帮助。
This is actually very simple and you don't need code to do it. (You could, I guess)
You need to go into the rdlc page properties and set the PageSize to Width: 11in, Height: 8.5in or whatever measurements the landscape report needs.
This is very poorly documented in VS.
If you need to let the user toggle between Landscape and Portrait, the only way I've found is to create two separate reports, but if it is a fairly simple report you could generate the code at runtime.
Hope that helps.
这篇关于在横向打印报表查看器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!