feras salim feras salim - 7 months ago 42
Vb.net Question

Export Devexpress XtraPivotGrid with theme to pdf using Itextsharp

I am using DevExpress ASPXPivotGrid control for my

ASP.NET
site.I am also using DevExpress ASPXPivotGridExporter control to ASPXPivotGrid to pdf. The problem I am having is that ASPXPivotGridExporter cannot export themes and right to left languages. Exported output always come out with default formating and just left to right languages. I would like to know if its possible to export pivot grid with theme and with
rtl languages
? If not is there work around it with
ITextSharp
?
this what I tried so far

Response.ContentType = "application/pdf"
Response.AddHeader("content-disposition", "inline;filename=TestPage.pdf")
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Dim sw As New StringWriter()
Dim hw As New HtmlTextWriter(sw)
ASPXPivotGrid1.RenderControl(hw)
Dim sr As New StringReader(sw.ToString())
Dim pdfDoc As New Document(PageSize.A4, 10.0F, 10.0F, 100.0F, 0.0F)
Dim htmlparser As New HTMLWorker(pdfDoc)
PdfWriter.GetInstance(pdfDoc, Response.OutputStream)
pdfDoc.Open()
htmlparser.Parse(sr)
Using memoryStream As New MemoryStream
Chart1.SaveImage(memoryStream, ChartImageFormat.Png)
Dim img As Image = Image.GetInstance(memoryStream.GetBuffer())
img.ScalePercent(75.0F)
pdfDoc.Add(img)
End Using
pdfDoc.Close()
Response.Write(pdfDoc)
Response.[End]()

Answer

using aspxpivotgridexporter doesn't support right to left languages. but finally i was able to find a work around by exporting pivot grid to html using pivot grid exporter then I can add the needed styles to the resulting html file and adding the direction to the text wither rtl or ltr