on 05-23-2011 4:06 PM
We change the datasource of a report from ODBC into XML. The column names are different. We enable the FieldMapping Event, but it doesn't fire.
Is there a known problem..?
Does it work??
We like to know if we have to invest more time or can better search another solution.
Tia
Hans
Our code:
report.Load(@"D:\Test\CR\afroep_xml_omgezet.rpt");
report.AfterFormatPage += new FormatPageEventHandler(report_AfterFormatPage);
report.BeforeFormatPage += new FormatPageEventHandler(report_BeforeFormatPage);
report.NoData += new FormatPageEventHandler(report_NoData);
report.FieldMapping += new FieldMappingEventHandler(report_FieldMapping);
report.FormatSection += new FormatSectionEventHandler(report_FormatSection);
EventEnabledArgs enableArgs = new EventEnabledArgs();
enableArgs.FieldMappingEnabled = true;
enableArgs.FormattingEnabled = true;
report.EnableEvent(enableArgs);
report = ChangeConnectionInfo(report);
report.VerifyDatabase(); <- does not trigger the FieldMappint event; reports does not shown any fields
void report_FieldMapping(FieldMappingEventArgs fieldMappingargs)
{
Console.WriteLine("report_FieldMapping");
String aa = fieldMappingargs.ReportFieldsMappings[0].FieldName;
fieldMappingargs.ReportFieldsMappings[0].FieldName = "Customer ID";
fieldMappingargs.ReportFieldsMappings[0].MappingToFieldIndex = 1;
fieldMappingargs.ReportFieldsMappings[0].TableName = "Customer";
////FieldMappingEventData a = new FieldMappingEventDataClass();
//a.ReportFieldsMappingInfoList[0].DatabaseFieldName = "Customer ID";
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Hans,
Yes it should, Trevor did test it but it only works when the database driver changes. I'm going to close this post since you have the other one going.
I suggest you purchase a case and a Rep here can work with you. We'll need to get your reports and data sources, old and new.
We can't attach files to forums.
Thank you
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Last time I saw field mapping work they way you expect it to was with the RDC. In the CR .NET SDK, if your fields aren't present or don't match we'll just drop the data from the report. If you plan to change database drivers you should ensure all your table and field names remain exactly the same.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.