Could you point to any online example to use Infragistics.Documents for PDF ?
Thanks ..
Hello,
The following are online samples for using the PDF feature:
http://samples.infragistics.com/aspnet/Samples/WebDataGrid/Data/Document-Exporter/Default.aspx?cn=document-exporter&sid=956dc5cd-b842-4cd9-8e92-940fdd3425b2.
http://samples.infragistics.com/reporting/RunSamples.aspx?cn=print-and-export#/print-and-export/export-a-report.
In the 'Windows Form Feature Browser' if you have marked 'Samples' before installing the WinFroms controls, there is a sample called 'Samples Gallery' under the Publishing and Printing' tab.
Please feel free to let me know if I misunderstood you or if you have any other questions.
Thanks on quick answer but it is not what I need ..
I can not use [WebDataGrid] exporter.Is any example to create pdf from "raw data" not data from "grid" ..
I need to create PDF using Infragistics35.WebUI.Documents.v9.1Our input format is custom xml and we have to create PDF on similar way that we create EXCEL with Infragistics35.WebUI.Excel.v9.1 ..
Hi dmcmichael,
The following sample illustrates how a custom PDF/XPS report may be generated:
http://samples.infragistics.com/aspnet/Samples/Infragistics.Documents/Display/Export%20to%20PDF%20or%20XPS/Default.aspx?cn=infragistics-documents&sid=1ee1141c-b6aa-4904-9aa8-dcb724811069
You may also find useful information regarding writing reports in our documentation at:
http://help.infragistics.com/NetAdvantage/ASPNET/2011.2/CLR4.0/?page=DocumentEngine_Writing_Reports.html
Please let me know if this helps.
Best Regards,
Petar IvanovDeveloper Support EngineerInfragistics, Inc.http://ko.infragistics.com/support
Not..
I can not use WEB CONTROL for this.
It will not run on web application.
Our task is to create PDF document that looks as EXCEL spreadsheet from XML.
Look at code bellow [I could not figure out how to attach file on this post ?].
It has 2 test methods :
TestWithoutUltraWebGrid()
TestWithUltraWebGrid()
We can not use TestWithUltraWebGrid()
Because our XML has nested structure [I think that it is limitation on web grid]
Ex
<A>
</A>
<\A>
Do you have any example similar what I am doing in that code ?
class PdfCreator {
public byte[] TestWithoutUltraWebGrid() { //creates the report Report r = new Report(); //creates the section ISection sect1 = r.AddSection(); //creates a non repeating header ISectionHeader sect1Head = sect1.AddHeader(); sect1Head.Repeat = false; sect1Head.Height = 80; //------------------------------------------------------------------- //styles used in the header Infragistics.Documents.Report.Text.Style headerstyle = new Infragistics.Documents.Report.Text.Style(new Font("Old English Text MT", 32), Brushes.Black); Infragistics.Documents.Report.Text.Style headerSmall = new Infragistics.Documents.Report.Text.Style(new Font("Arial", 8), Brushes.Black); Infragistics.Documents.Report.Text.Style headerTiny = new Infragistics.Documents.Report.Text.Style(new Font("Arial", 6), Brushes.Black);
//adds a group to the header to help layout contents IGroup sect1HeadGroup = sect1Head.AddGroup(0, 0); //using grid to layout first set of elements IGrid gridObject = sect1HeadGroup.AddGrid(); //------------------------------------------------------------------- //sets some layout properties on the object gridObject.Borders.Corners.All = new Infragistics.Documents.Report.Corner( Infragistics.Documents.Graphics.Pens.DodgerBlue, Infragistics.Documents.Utils.Converter.PixelsToPoints(10));
gridObject.Borders.All = new Infragistics.Documents.Report.Border( Infragistics.Documents.Graphics.Pens.DodgerBlue);
gridObject.Margins.All = Infragistics.Documents.Utils.Converter.PixelsToPoints(10);
gridObject.Paddings.All = Infragistics.Documents.Utils.Converter.PixelsToPoints(10); //------------------------------------------------------------------- //using the gridpattern to style the grid GridPattern gridPattern = new GridPattern(); gridPattern.Margins = new Margins(5); gridPattern.Paddings = new Paddings(10); gridObject.ApplyPattern(gridPattern);
//adds 5 columns, columns must be added for a grid element gridObject.AddColumn(); gridObject.AddColumn(); gridObject.AddColumn(); gridObject.AddColumn(); gridObject.AddColumn();//5 Columns for (int II = 1; II < 50; II++) { IGridRow gridROW = gridObject.AddRow(); AddRow(ref gridROW, II); } return SaveToMemory(ref r); }
public byte[] TestWithUltraWebGrid() { Infragistics.Documents.Report.Report report = new Infragistics.Documents.Report.Report(); Infragistics.Documents.Report.Section.ISection section1 = report.AddSection(); section1.PageMargins = new Infragistics.Documents.Report.Margins(50);
Infragistics.WebUI.UltraWebGrid.UltraWebGrid uwgrid = new Infragistics.WebUI.UltraWebGrid.UltraWebGrid();
System.Data.DataSet dsWebGrid = new System.Data.DataSet("WebGrid"); string xmlurl = @"C:\Tasks\Web-Managers\Test\ExcelTest_WebDocumentExporter\TIF\GridData2.xml"; dsWebGrid.ReadXml(xmlurl); uwgrid.DataSource = dsWebGrid; uwgrid.DataBind();
Infragistics.WebUI.UltraWebGrid.DocumentExport.UltraWebGridDocumentExporter ex = new UltraWebGridDocumentExporter(); ex.Export(uwgrid, section1);
return SaveToMemory(ref report); }
private void AddRow(ref IGridRow gridROW, int rowCt) { IGridCell gridCELL = null; IText cellTEXT = null;
gridCELL = gridROW.AddCell(); cellTEXT = gridCELL.AddText(); cellTEXT.AddContent("Row [" + rowCt + "]Coll[1]"); gridCELL.Borders = new Borders(new Pen(Colors.Black, DashStyle.Solid), 2);
gridCELL = gridROW.AddCell(); cellTEXT = gridCELL.AddText(); cellTEXT.AddContent("Row [" + rowCt + "]Coll[2]"); gridCELL.Borders = new Borders(new Pen(Colors.Black, DashStyle.Solid), 2);
gridCELL = gridROW.AddCell(); cellTEXT = gridCELL.AddText(); cellTEXT.AddContent("Row [" + rowCt + "]Coll[3]"); gridCELL.Borders = new Borders(new Pen(Colors.Black, DashStyle.Solid), 2);
gridCELL = gridROW.AddCell(); cellTEXT = gridCELL.AddText(); cellTEXT.AddContent("Row [" + rowCt + "]Coll[4]"); gridCELL.Borders = new Borders(new Pen(Colors.Black, DashStyle.Solid), 2);
gridCELL = gridROW.AddCell(); cellTEXT = gridCELL.AddText(); cellTEXT.AddContent("Row [" + rowCt + "]Coll[5]"); gridCELL.Borders = new Borders(new Pen(Colors.Black, DashStyle.Solid), 2);
}
private byte[] SaveToMemory(ref Report PDFReport) { byte[] bytesExcel = null; try { using (System.IO.MemoryStream theStream = new System.IO.MemoryStream()) { PDFReport.Publish(theStream, FileFormat.PDF); bytesExcel = (byte[])Array.CreateInstance(typeof(byte), theStream.Length); theStream.Position = 0; theStream.Read(bytesExcel, 0, (int)theStream.Length); theStream.Close(); } } catch (Exception e) { throw new Exception("Failed to convert to Excel workbook to stream.\n" + e.Message); } return bytesExcel; }
i am just curious is it the same way to creat pdf vb.net with other documents. can i use the same method. if so,that would be good to learn one way.
Not now.. Probablly latter when I start project. From your links I found decent examples "for start" ..
Thanks
Please let me know if you need further assistance with this matter.
Apologies for the previous misconception.
Our 11.1 documentation still has information on the Infragistics.Documents library:
http://help.infragistics.com/NetAdvantage/ASPNET/2011.1/CLR4.0/?page=DocumentEngine_Writing_Reports.html
In your scenario you may find useful information in the following resources for adding a table/grid to a report:
http://help.infragistics.com/Help/NetAdvantage/ASPNET/2011.1/CLR4.0/html/DocumentEngine_Tables.html
http://help.infragistics.com/Help/NetAdvantage/ASPNET/2011.1/CLR4.0/html/DocumentEngine_Grids.html
As per using the UltraWebGrid in your implementation, UltraWebGrid may be bound to hierarchical XML as described at:
http://help.infragistics.com/NetAdvantage/ASPNET/2011.1/CLR4.0/?page=WebGrid_Binding_WebGrid_to_an_XML_Data_Source.html
If you wish to attach a file to your post, you can add it through the Options tab on the reply page.
Please feel free to contact me with any questions.