`
wfdoublext
  • 浏览: 126166 次
  • 性别: Icon_minigender_1
  • 来自: 青岛
社区版块
存档分类
最新评论

PDF-activereport

    博客分类:
  • .net
阅读更多
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Text;
using System.Drawing;
using System.Drawing.Printing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Security.Cryptography;
using DataDynamics.ActiveReports;
using ArExports = DataDynamics.ActiveReports.Export;
using DataDynamics.ActiveReports.Export.Pdf;
using System .IO ;
using  LackIS.components;

namespace LackIS
{
	/// <summary>
	/// LackDetialListPrint の概要の説明です。

	/// </summary>
	public class LackDetialListPrint : System.Web.UI.Page
	{
		#region 変量
		
		protected ArExports.Pdf.PdfExport pdf=new PdfExport();
		protected	ActiveReport rpt;
		
		//protected string name="欠品明細リスト印刷.PDF";
		#endregion
		private void Page_Load(object sender, System.EventArgs e)
		{
			
			
				PrintModule	rpt1=new PrintModule();
				rpt1.PageSettings.Margins.Left =0.2f;
				rpt1.PageSettings.Margins.Top=0.15f;
				rpt1.PageSettings.Margins.Right =0.15f;
				rpt1.PageSettings.Margins.Bottom=0.05f;
				rpt1.PageSettings .PaperKind =PaperKind .A4 ;//用紙タイプを設定する

				rpt1.PageSettings .Orientation =DataDynamics.ActiveReports .Document .PageOrientation.Landscape;
				rpt1.SubReport1.Report=LineItemcount;
				if(dt!=null)
				{
					if(dt.Rows .Count <=0)
					{
						Page.RegisterStartupScript("1","<script>alert('ご指定の抽出条件でデータがありません。')</script>");
				
					}

					else
					{
						Response.ContentType = "application/pdf";
						Response.AddHeader("content-disposition","attachment; filename=LackList.PDF");
						
						System.IO.MemoryStream memStream = new System.IO.MemoryStream();
						rpt1.DataSource = dt ;
						rpt1.TextBox3.Text=storenm;//店名
						rpt1.TextBox4.Text=datatype;//調査時間
						if(dt.Rows.Count%15==0)
							con=dt.Rows.Count/15;
						else
							con=dt.Rows.Count/15+1;
						int bb=dt.Rows.Count-dt.Rows.Count/15*15;
						if((bb+this.PdfList.Rows.Count)>14)
						{
							for(int i=0;i<14-bb;i++)
							{
								DataRow dtNew = dt.NewRow();
								dtNew[0]=0;
								dtNew[1]="";
								dtNew[2]="";
								dtNew[3]="";
								dtNew[4]="";
								dtNew[5]="";
								dtNew[6]="";
								//dtNew[7]=1000;
								//dtNew[8]=1000;
								//dtNew[9]=0;
								dt.Rows.Add(dtNew);
							}
						}
						rpt1.TextBox6.Text=this.con.ToString();
						rpt1.Run();
						pdf.Export(rpt1.Document, memStream);
						Response.BinaryWrite(memStream.ToArray());	
						Response.End();
					}
				}
				else
					Page.RegisterStartupScript("1","<script>logerror()</script>");
				
				
			
			}
			else//週別、月別
			{
				PrintModuleMW	rpt2=new PrintModuleMW();
				rpt2.PageSettings.Margins.Left =0.2f;
				rpt2.PageSettings.Margins.Top=0.15f;
				rpt2.PageSettings.Margins.Right =0.15f;
				rpt2.PageSettings.Margins.Bottom=0.1f;
				rpt2.PageSettings .PaperKind =PaperKind .A4 ;//用紙タイプを設定する 
				rpt2.PageSettings .Orientation =DataDynamics.ActiveReports .Document .PageOrientation.Landscape;
				rpt2.SubReport1.Report=LineItemcount;

				if(dt!=null)
				{
					if(dt.Rows .Count <=0)
					{
						Page.RegisterStartupScript("2","<script>alert('ご指定の抽出条件でデータがありません。')</script>");	
				
					}
					else
					{
						Response.ContentType = "application/pdf";
						Response.AddHeader("content-disposition","attachment; filename=LackList.PDF");
						System.IO.MemoryStream memStream = new System.IO.MemoryStream();
						if(dt.Rows.Count%15==0)
							con=dt.Rows.Count/15;
						else
							con=dt.Rows.Count/15+1;
						int bb=dt.Rows.Count-dt.Rows.Count/15*15;
						if((bb+this.PdfList.Rows.Count)>14)
						{
							for(int i=0;i<14-bb;i++)
							{
								DataRow dtNew = dt.NewRow();
								dtNew[0]=0;
								dtNew[1]="";
								dtNew[2]="";
								dtNew[3]="";
								dtNew[4]="";
								dtNew[5]="";
								dtNew[6]="";
								//dtNew[7]=1000;
								dtNew[8]=0;
								dt.Rows.Add(dtNew);
							}
						}
						rpt2.DataSource = dt ;
						rpt2.DataMember = dt.TableName;
						rpt2.TextBox3.Text=storenm;//店名
						rpt2.TextBox4.Text=datatype;//調査時間

						
						rpt2.TextBox6.Text=this.con.ToString();
						rpt2.Run();
						pdf.Export(rpt2.Document, memStream);
						Response.BinaryWrite(memStream.ToArray());	
						Response.End();
					}
				}
				else
					Page.RegisterStartupScript("1","<script>logerror()</script>");
				

				
			}
			#endregion

		}

 

分享到:
评论

相关推荐

    Active Report

    允许您动态的建立和修改报表Report Creation API提供了完整的运行时访问报表对象和成员功能。最终用户报表设计器终端用户设计器为您提供了向您应用程序中加入设计器的功能,同时提供了终端用户报表编辑功能。控件的...

    FastReport.v4.15 for.Delphi.BCB.Full.Source企业版含ClientServer中文修正版支持D4-XE5

    + [enterprise] added property "Scheduler" - "Active" in server configuration - enable of scheduler + [enterprise] added property "Scheduler" - "Debug" in server configuration - enable writing of ...

    ComponentOne 2012 V2 ActiveReports 7 1/3

    ActiveReports includes Adobe PDF export with advanced encryption and international font support, Microsoft Excel export, and Rich Text Format (RTF) export. The extensive API allows fine control over ...

    FastReport_VCL_v6.3.5_Professional_Full_Source_Code_D7-D10.3_Rio

    Current version ---------------------------- ...- Fixed active cell for XLS with several sheets in the BIFF8 export - Fixed UTF-8 support for Geodata from DBF * Improved FireDAC DB components

    SynPDF-master 2016-07-12

    with some report-oriented methods (including complex rtf with `TGDIPages.AppendRichEdit`) - for basic reporting features, it is pretty much the solution. The 2nd and 3rd ways are preferred, for most...

    基于分布式抽样的非近视主动信息采集规划技术报告_Technical Report Distributed Sampling-ba

    基于分布式抽样的非近视主动信息采集规划技术报告_Technical Report Distributed Sampling-based Planning for Non-Myopic Active Information Gathering.pdf

    NIST SP800-28.pdf

    this report is to provide an overview of active content, its technological underpinnings, and suitable security measures, so that the reader understands the associated security risks and can make an...

    ActiveReports 7 2013 V1 4/4

    ActiveReports includes Adobe PDF export with advanced encryption and international font support, Microsoft Excel export, and Rich Text Format (RTF) export. The extensive API allows fine control over ...

    报表开发实列

    active report 报表开发实列.pdf

    Data_Dynamics_ActiveReports_2.5.0.1322.rar

    DataDynamics ActiveReports ActiveX... Net、PDF文档等。 与Visual Studio用户界面和环境轻松无缝集成。 它拥有所有过程或工作流程中可能需要的工具和功能。 为了更方便,它支持拖放。 您还可以下载Atozed CrossTalk。

    ComponentOne 2012 V2 ActiveReports 7(完整安装)

    ActiveReports includes Adobe PDF export with advanced encryption and international font support, Microsoft Excel export, and Rich Text Format (RTF) export. The extensive API allows fine control over ...

    ComponentOne 2012 V2 ActiveReports 7 3/3

    ActiveReports includes Adobe PDF export with advanced encryption and international font support, Microsoft Excel export, and Rich Text Format (RTF) export. The extensive API allows fine control over ...

    ActiveReports 7 2013 V1 1/4

    ActiveReports includes Adobe PDF export with advanced encryption and international font support, Microsoft Excel export, and Rich Text Format (RTF) export. The extensive API allows fine control over ...

    ActiveReports 7 2013 V1 3/4

    ActiveReports includes Adobe PDF export with advanced encryption and international font support, Microsoft Excel export, and Rich Text Format (RTF) export. The extensive API allows fine control over ...

    ActiveReports 7 2013 V1 2/4

    ActiveReports includes Adobe PDF export with advanced encryption and international font support, Microsoft Excel export, and Rich Text Format (RTF) export. The extensive API allows fine control over ...

    BURNINTEST--硬件检测工具

    - Enhanced the mechanism to report memory hardware errors in the Memory torture test. Release 5.3 build 1033 WIN32 release 1 October 2008 - Changes to correct a BurnInTest crash problem on some ...

    Download.zip

    通过这个可以在新建标签中下载所需要的PDF文件,先需要将代码生成的Report引用进去,才能下载。具体的代码可以参照PDF文章。

    WPTools.v6.29.1.Pro

    - if flag wpDontAddExternalFontLeading is active in property FormatOptionsEx the text will be formatted more like WPTools4/MS-Word. You can alternatively set global variable ...

    人工通用智能的火花 GPT-4的早期实验 (英文).pdf

    Abstract Artificial intelligence (AI) researchers have been developing and refining large language models (LLMs) ...of GPT-4, when it was still in active development by OpenAI. We contend t

    xen_interface3.0.pdf

    DISCLAIMER: This documentation is always under active development and as such there may be mistakes and omissions-watch out for these and please report any you find to the developer's mailing list....

Global site tag (gtag.js) - Google Analytics