Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
270
Send data from .xaml to report
posted

Hi,
m using report object to generating print preview for xamdatagrid , however if the grid contains data in bulk,preview generation gets very slow and takes quite a long time.is there any solution or work aorund to make its performance better?

i am not using physically existed report item for rendering, rather m creating report object from code and utilizing it . this is my coode snippet

Report reportObj = new Report(); reportObj.PageHeader = "PageHeader"; reportObj.ReportSettings.Margin = new Thickness(50, 50, 50, 50);

EmbeddedVisualReportSection section = new EmbeddedVisualReportSection(xamdatagrid); reportObj.Sections.Add(section); XamReportPreview previewer = new XamReportPreview(); try { previewer.GeneratePreview(reportObj, false, true);

Window window = new Window(); window.Title = WindowTitle; window.Content = previewer; window.ShowDialog(); } catch (Exception ex) { // LogHelper.WriteLog(ex.ToString()); }

My reqiurement is to render complete grid at stretch to the preview so that user can determine the number of pages and record count for printing from it.but my application gets hanged when the data size increases and takes quite along time to response and render preview which seems as application contain some bug or  unreacheable code,which is not the case

looking forward to your reply,thanks in advance