Please have a look at below code snippet -
in the first snippet I have made constant to provide a static format to string.. the second uses the constant to string.format the values received at runtime. But problem i m facing is - I am loosing the tag names, for example - <PolicyNumber > , <UserID>; I only recieve the value in xml nodes not the node names.. Please let me know if there is any way to maintain the xml structure from snippet 2.
*************** *************** *************** *************** *************** *************** **
#1.
public static string conststrReportX ML =
"<PARAMETERS><R eportPath>\\\\% COMPUTERNAME%\\ ezsb\\PMS\\</ReportPath><Rep ortName>ZZPMS</ReportName><For ceReport>True</ForceReport><Da taConnectionStr ing>DSN=COSPROD </DataConnectionS tring><ReturnTy pe>5</ReturnType><Dis playFormat>5</DisplayFormat>" +
"<PolicyNumber> {0}</PolicyNumber>" +
"<CrystalReport Name>{1}</CrystalReportNa me>" +
"<CrystalConnec tion>{2}</CrystalConnecti on>" +
"<UserID>{3 }</UserID>" +
"<Password> {4}</Password>" +
"<DataBaseName> {5}</DataBaseName>" +
"<REPORTPARAMET ERS>" +
"{6}{7}{8}{9}{1 0}{11}" +
"</REPORTPARAMETER S>" +
"</PARAMETERS>";
*************** *************** *************** *************** *************** *************** **
#2
strXmlReportReq uest = string.Format(c onststrReportXM L, strPolicyNumber , "rptMainLocatio nActivity.rpt",
Session["ReportServerNa me"].ToString(), Session["ReportUser ID"].ToString(),
Session["ReportPassword "].ToString(), Session["ReportDatabase Name"].ToString(),
"<BeginDate >" + strBeginDate + "</BeginDate>",
"<EndDate>" + strEndDate + "</EndDate>",
"<PolicyNumbers >" + strPolicyNumber s + "</PolicyNumbers>" ,
"<UserName> " + strUserName + "</UserName>",
"<LocationTypes >" + strLocationType s + "</LocationTypes>" ,
"<LocationTypeN ames>" + strLocationType Names + "</LocationTypeNam es>");
*************** *************** *************** *************** *************** ***************
Thanks in advance
in the first snippet I have made constant to provide a static format to string.. the second uses the constant to string.format the values received at runtime. But problem i m facing is - I am loosing the tag names, for example - <PolicyNumber > , <UserID>; I only recieve the value in xml nodes not the node names.. Please let me know if there is any way to maintain the xml structure from snippet 2.
*************** *************** *************** *************** *************** *************** **
#1.
public static string conststrReportX ML =
"<PARAMETERS><R eportPath>\\\\% COMPUTERNAME%\\ ezsb\\PMS\\</ReportPath><Rep ortName>ZZPMS</ReportName><For ceReport>True</ForceReport><Da taConnectionStr ing>DSN=COSPROD </DataConnectionS tring><ReturnTy pe>5</ReturnType><Dis playFormat>5</DisplayFormat>" +
"<PolicyNumber> {0}</PolicyNumber>" +
"<CrystalReport Name>{1}</CrystalReportNa me>" +
"<CrystalConnec tion>{2}</CrystalConnecti on>" +
"<UserID>{3 }</UserID>" +
"<Password> {4}</Password>" +
"<DataBaseName> {5}</DataBaseName>" +
"<REPORTPARAMET ERS>" +
"{6}{7}{8}{9}{1 0}{11}" +
"</REPORTPARAMETER S>" +
"</PARAMETERS>";
*************** *************** *************** *************** *************** *************** **
#2
strXmlReportReq uest = string.Format(c onststrReportXM L, strPolicyNumber , "rptMainLocatio nActivity.rpt",
Session["ReportServerNa me"].ToString(), Session["ReportUser ID"].ToString(),
Session["ReportPassword "].ToString(), Session["ReportDatabase Name"].ToString(),
"<BeginDate >" + strBeginDate + "</BeginDate>",
"<EndDate>" + strEndDate + "</EndDate>",
"<PolicyNumbers >" + strPolicyNumber s + "</PolicyNumbers>" ,
"<UserName> " + strUserName + "</UserName>",
"<LocationTypes >" + strLocationType s + "</LocationTypes>" ,
"<LocationTypeN ames>" + strLocationType Names + "</LocationTypeNam es>");
*************** *************** *************** *************** *************** ***************
Thanks in advance