我正在努力解决SSRS中的问题。我创建了一个在报表查看器中看起来很好的客户发票,但是需要将其设置为以某种方式打印。
此报告有4个主要元素。
这甚至可能吗?如果没有,最终用户已经接受了发票的前3个部分,必要时重复,最后一页作为付款细节。
提前致谢
答案 0 :(得分:0)
在每个页面上重复报告页眉和页脚应该非常简单。
现在,如果您希望在每个页面上重复报告内容以外的其他信息,则可以执行以下操作:
您可能已经知道,在使用Tablix时,可以在每个页面上重复表头行。通过将Tablix添加到单个列并使其跨越页面大小,在添加矩形的标题和数据行中使其像报表正文一样,这可以用于我们的优势。在标题行中,您可以添加您希望在下一页重复的任何数据/文本。
现在,您希望页面的背面有文字,您可能不希望在每个页面上重复此操作。由于页面背面始终是相同的静态数据,因此您可以按照现在设置的方式生成报告,并在报告页面之间插入静态页面。
要获得最后一部分,您可以使用以下代码:
String inputFilePath1 = @""; //back of page
String inputFilePath2 = @""; //report
String outPutFilePath = @""; //final report
PDFDocument doc1 = new PDFDocument(inputFilePath1);
PDFDocument doc2 = new PDFDocument(inputFilePath2);
// Get a page from the first document. -> back of page
PDFPage page = (PDFPage)doc1.GetPage(0);
for(int i = 1; i <= doc2.PageCount; i++)
{
if (i % 2 == 1)
{
// Insert the page to the second document at specified position.
doc2.InsertPage(page, i);
}
}
// Output the new document.
doc2.Save(outPutFilePath)