Hello ,
I tried to export many objects via a compositelinks, in my webpage there are many aspxpivotgrids so i need many aspxpivotgridexporters , when i tried the code below with one aspxpivotgridexporter , everything goes well , but when i tried to add another aspxpivotgridexporter on the page (via toolbox, drag and drop and not dynamically) i have the folowing error (see printscreen attached) . That's the system.web.ui that found that the aspxgridexporter have the same id 'state'.This error is caused by the second aspxgridexporter on the page , if i delete it . the error disappears , i've tried to find another case in the knowledge base but without succes . Here after you'll find my code sample . Can you help me to find a solution , because i need it urgently to finished an important project… Thanks for your help.
Jean.
Steps to Reproduce:
two aspxpivotgrids on a same page
two aspxgridexporters on a same page
a fonction for exporting via links and compositelinks
Actual Results:
Multiple objects with same id 'state'
Expected Results:
Private Sub ExportPDF()
Dim ps As New PrintingSystem()
With ps
.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.A3
.PageSettings.Landscape = True
.PageMargins.Right = 39
.PageMargins.Left = 39
End With
Dim link1 As New PrintableComponentLink()
link1.Component = ASPxPivotGridExporter1
link1.PrintingSystem = ps
With link1.PrintingSystem
.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.A3
.PageSettings.Landscape = True
.PageMargins.Right = 39
.PageMargins.Left = 39
DocSize = .PageSettings.Bounds.Width
ScaleFact = .PageSettings.UsablePageSize.Width
.Graph.StringFormat = New BrickStringFormat(StringAlignment.Center, StringAlignment.Center)
link1.CreateDocument()
link1.PrintingSystem.Document.AutoFitToPagesWidth = 1
End With
Dim linkGridHeader As New Link
AddHandler linkGridHeader.CreateDetailArea, AddressOf GridHeader
linkGridHeader.PrintingSystem = ps
With linkGridHeader.PrintingSystem
.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.A3
.PageSettings.Landscape = True
.PageMargins.Right = 39
.PageMargins.Left = 39
End With
Dim linkGridSimCard As New PrintableComponentLink
linkGridSimCard.Component = ASPxPivotGridExporter2
linkGridSimCard.PrintingSystem = ps
With linkGridSimCard.PrintingSystem
.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.A3
.PageSettings.Landscape = True
.PageMargins.Right = 39
.PageMargins.Left = 39
End With
Dim linkLabelSimCard As New Link()
AddHandler linkLabelSimCard.CreateDetailArea, AddressOf LabelSimCard
linkLabelSimCard.PrintingSystem = ps
With linkLabelSimCard.PrintingSystem
.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.A3
.PageSettings.Landscape = True
.PageMargins.Right = 39
.PageMargins.Left = 39
End With
Dim linkSummaryChart As New Link()
AddHandler linkLabelSimCard.CreateDetailArea, AddressOf SummaryCharts
linkSummaryChart.PrintingSystem = ps
With linkSummaryChart.PrintingSystem
.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.A3
.PageSettings.Landscape = True
.PageMargins.Right = 39
.PageMargins.Left = 39
End With
Dim compositeLink As New CompositeLink()
compositeLink.Links.AddRange(New Object() {linkGridHeader, link1, linkLabelSimCard, linkSummaryChart}) ', link1, link2
compositeLink.PrintingSystem = ps
AddHandler compositeLink.CreateMarginalFooterArea, AddressOf compositeLink_Footer
AddHandler compositeLink.CreateMarginalHeaderArea, AddressOf compositeLink_Header
compositeLink.CreateDocument()
compositeLink.PrintingSystem.Document.AutoFitToPagesWidth = 1
compositeLink.PrintingSystem.ExportOptions.Pdf.DocumentOptions.Author = "Test"
With compositeLink.PrintingSystem.PageSettings
.PrinterName = ""
.Landscape = True
.LeftMargin = 39
.RightMargin = 39
.PaperKind = System.Drawing.Printing.PaperKind.A3
End With
Using stream As New MemoryStream()
compositeLink.PrintingSystem.ExportToPdf(stream)
Response.Clear()
Response.Buffer = False
Response.AppendHeader("Content-Type", "application/Pdf")
Response.AppendHeader("Content-Transfer-Encoding", "binary")
Response.AppendHeader("Content-Disposition", "attachment; filename=SingleReport.Pdf")
Response.BinaryWrite(stream.GetBuffer())
Response.End()
End Using
ps.Dispose()
End Sub
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hello Jean,
The fix has been included in the next minor update v2008 vol 3.5. It will be available soon.
Thanks,
Alex.