本文整理汇总了C#中fyiReporting.RDL.Report.RunRender方法的典型用法代码示例。如果您正苦于以下问题:C# Report.RunRender方法的具体用法?C# Report.RunRender怎么用?C# Report.RunRender使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fyiReporting.RDL.Report
的用法示例。
在下文中一共展示了Report.RunRender方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExportReport
/// <summary>
/// Save the report to the output selected.
/// </summary>
/// <param name='report'>
/// Report.
/// </param>
/// <param name='FileName'>
/// File name.
/// </param>
private void ExportReport(Report report, string FileName, OutputPresentationType exportType)
{
OneFileStreamGen sg = null;
try
{
sg = new OneFileStreamGen(FileName, true);
report.RunRender(sg, exportType);
}
catch (Exception ex)
{
Gtk.MessageDialog m = new Gtk.MessageDialog(null, Gtk.DialogFlags.Modal, Gtk.MessageType.Error,
Gtk.ButtonsType.Ok, false,
ex.Message);
m.Run();
m.Destroy();
}
finally
{
if (sg != null)
{
sg.CloseMainStream();
}
}
return;
}
示例2: Generate
private void Generate(Report report)
{
MemoryStreamGen sg=null;
try
{
sg = new MemoryStreamGen("ShowFile.aspx?type=", null, this.RenderType);
report.RunRender(sg, _RenderType, this.UniqueID);
_CSS = "";
_JavaScript = "";
switch (_RenderType)
{
case OutputPresentationType.ASPHTML:
case OutputPresentationType.HTML:
_CSS = report.CSS;//.Replace("position: relative;", "position: absolute;");
_JavaScript = report.JavaScript;
_Html = sg.GetText();
break;
case OutputPresentationType.XML:
_Xml = sg.GetText();
break;
case OutputPresentationType.CSV:
_Csv = sg.GetText();
break;
case OutputPresentationType.PDF:
{
MemoryStream ms = sg.MemoryList[0] as MemoryStream;
_Object = ms.ToArray();
break;
}
}
// Now save off the other streams in the session context for later use
IList strms = sg.MemoryList;
IList names = sg.MemoryNames;
for (int i=1; i < sg.MemoryList.Count; i++) // we skip the first one
{
string n = names[i] as string;
MemoryStream ms = strms[i] as MemoryStream;
Context.Session[n] = ms.ToArray();
}
}
catch(Exception e)
{
Console.WriteLine(e.Message);
}
finally
{
if (sg != null)
{
sg.CloseMainStream();
}
}
if (report.ErrorMaxSeverity > 0)
{
AddError(report.ErrorMaxSeverity, report.ErrorItems);
report.ErrorReset();
}
return;
}
示例3: SaveAs
/// <summary>
/// Save the file. The extension determines the type of file to save.
/// </summary>
/// <param name="FileName">Name of the file to be saved to.</param>
/// <param name="ext">Type of file to save. Should be "pdf", "xml", "html", mht.</param>
private void SaveAs(Report report, string FileName, string type)
{
string ext = type.ToLower();
OneFileStreamGen sg=null;
try
{
if (ext == "tifb")
FileName = FileName.Substring(0, FileName.Length - 1); // get rid of the 'b'
sg = new OneFileStreamGen(FileName, true); // overwrite with this name
switch(ext)
{
case "pdf":
if (this._StampInfo == null)
report.RunRender(sg, OutputPresentationType.PDF);
else
SaveAsPdf(report, sg);
break;
case "xml":
report.RunRender(sg, OutputPresentationType.XML);
break;
case "mht":
report.RunRender(sg, OutputPresentationType.MHTML);
break;
case "html": case "htm":
report.RunRender(sg, OutputPresentationType.HTML);
break;
case "csv":
report.RunRender(sg, OutputPresentationType.CSV);
break;
case "xlsx":
report.RunRender(sg, OutputPresentationType.Excel);
break;
case "rtf":
report.RunRender(sg, OutputPresentationType.RTF);
break;
case "tif": case "tiff":
report.RunRender(sg, OutputPresentationType.TIF);
break;
case "tifb":
report.RunRender(sg, OutputPresentationType.TIFBW);
break;
default:
Console.WriteLine("Unsupported file extension '{0}'. Must be 'pdf', 'xml', 'mht', 'csv', 'xslx', 'rtf', 'tif', 'tifb' or 'html'", type);
returnCode = 8;
break;
}
}
catch(Exception e)
{
Console.WriteLine(e.Message);
returnCode = 8;
}
finally
{
if (sg != null)
{
sg.CloseMainStream();
}
}
if (report.ErrorMaxSeverity > 0)
{
// have errors fill out the msgs
Console.WriteLine("{0} has the following runtime errors:", FileName);
foreach (string emsg in report.ErrorItems)
{
Console.WriteLine(emsg); // output message to console
}
report.ErrorReset();
}
return;
}
示例4: SaveAs
/// <summary>
/// Save the file. The extension determines the type of file to save.
/// </summary>
/// <param name="FileName">Name of the file to be saved to.</param>
/// <param name="ext">Type of file to save. Should be "pdf", "xml", "html", mht.</param>
private void SaveAs(Report report, string FileName, string type)
{
string ext = type.ToLower();
OneFileStreamGen sg=null;
try
{
bool isOldPdf = false;
if (System.Environment.OSVersion.Platform == PlatformID.Unix && type=="pdf" ) {
if (System.IO.Directory.Exists("/usr/share/fonts/truetype/msttcorefonts")==false)
{
isOldPdf = true;
}
}
if (ext == "tifb")
FileName = FileName.Substring(0, FileName.Length - 1); // get rid of the 'b'
sg = new OneFileStreamGen(FileName, true); // overwrite with this name
switch(ext)
{
case "pdf":
if (this._StampInfo == null)
{
if (isOldPdf)
{
report.RunRender(sg, OutputPresentationType.PDFOldStyle);
}
else
{
report.RunRender(sg, OutputPresentationType.PDF);
}
}
else
SaveAsPdf(report, sg);
break;
case "xml":
report.RunRender(sg, OutputPresentationType.XML);
break;
case "mht":
report.RunRender(sg, OutputPresentationType.MHTML);
break;
case "html": case "htm":
report.RunRender(sg, OutputPresentationType.HTML);
break;
case "csv":
report.RunRender(sg, OutputPresentationType.CSV);
break;
case "xlsx":
report.RunRender(sg, OutputPresentationType.Excel);
break;
case "rtf":
report.RunRender(sg, OutputPresentationType.RTF);
break;
case "tif": case "tiff":
report.RunRender(sg, OutputPresentationType.TIF);
break;
case "tifb":
report.RunRender(sg, OutputPresentationType.TIFBW);
break;
default:
Console.WriteLine("Unsupported file extension '{0}'. Must be 'pdf', 'xml', 'mht', 'csv', 'xslx', 'rtf', 'tif', 'tifb' or 'html'", type);
returnCode = 8;
break;
}
}
catch(Exception e)
{
Console.WriteLine(e.Message);
returnCode = 8;
}
finally
{
if (sg != null)
{
sg.CloseMainStream();
}
}
if (report.ErrorMaxSeverity > 0)
{
// have errors fill out the msgs
Console.WriteLine("{0} has the following runtime errors:", FileName);
foreach (string emsg in report.ErrorItems)
{
Console.WriteLine(emsg); // output message to console
}
report.ErrorReset();
}
return;
}