Sunday, September 28, 2014

Reportviewer

Add an exception handler to the code and post results of the Stack Trace.



public string strReport = "rdlcmulkiyetinfo";
void Window_Loaded(object sender, RoutedEventArgs e)
{
try
{
var ds = new ReportsDetails();
var rptDataSource = new ReportDataSource("dsMulkiyet", ds.Tables["MulkiyetBase"]);
const string rdlcAdd = @"CCTrackingProgram.";
switch (strReport)
{
case "rdlcmulkiyetinfo":
var da = new CCTrackingProgram.ReportsDetailsTableAdapters.MulkiyetBaseTableAdapter();
var PerID = System.Windows.Application.Current.Windows.OfType<wpfOdemeTablosu>().FirstOrDefault();
rptTahsilatDetailsViewer.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(SubReportDoldur);
rptDataSource.Value = da.GetDataByMulkiyetSorgula(PerID.must_ID);//wpfOdemeTablosundan ID al;
break;
default:
break;
}
this.rptTahsilatDetailsViewer.LocalReport.ReportEmbeddedResource = rdlcAdd + strReport + ".rdlc";
this.rptTahsilatDetailsViewer.LocalReport.DataSources.Clear();
this.rptTahsilatDetailsViewer.LocalReport.DataSources.Add(rptDataSource);
this.rptTahsilatDetailsViewer.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.PrintLayout);
}
catch (Exception e)
{
Console.WriteLine("Error : {0}", e.Message);
Console.WriteLine("Stack Trace : {0}", e.StackTrace);

}
}





jdweng


No comments:

Post a Comment