Пример #1
0
 private static string GetReportPrint(string hostCountryCode, string partnerCountryCode, string conceptId)
 {
     var tpArticleReportBusiness = new TpArticleReportBusiness();
     var articleContent = tpArticleReportBusiness.GetArticleData(hostCountryCode, partnerCountryCode, conceptId);
     if (string.IsNullOrEmpty(articleContent.Trim())) return string.Empty;
     var htmlData = MakeCustomHtml(articleContent);
     return htmlData;
 }
 private void PopulateData()
 {
     var hostCountryIdParm = Request.QueryString["hostCountryCode"];
     var partnerCountryParm = Request.QueryString["partnerCountryCode"];
     var conceptId = Request.QueryString["conceptId"];
     var articleContent = string.Empty;
     if (!string.IsNullOrEmpty(hostCountryIdParm) && !string.IsNullOrEmpty(partnerCountryParm))
     {
         var tpArticleReportBusiness = new TpArticleReportBusiness();
         articleContent = tpArticleReportBusiness.GetArticleData(hostCountryIdParm, partnerCountryParm, conceptId);
     }
     dvContent.InnerHtml = articleContent;
 }
Пример #3
0
 private static string GetReportDoc(string hostCountryCode, string partnerCountryCode, string conceptId, string uniqueId)
 {
     //var htmlToWordConverter = new HtmlToWordConverter();
     //var url = string.Format("http://localhost/NestServiceApp/Report/ArticleReportDocExport.aspx?hostCountry={0}&partnerCountry={1}&conceptId={2}", hostCountry, partnerCountry, conceptId);
     var tpArticleReportBusiness = new TpArticleReportBusiness();
     var articleContent = tpArticleReportBusiness.GetArticleData(hostCountryCode, partnerCountryCode, conceptId);
     var htmlData = MakeCustomHtml(articleContent);
        // var mhtml = MHTConverter.ConvertWebPageToMHTString(url);
     var docData = new HtmlToWordConverter().Convert(htmlData);
        //var docData = htmlToWordConverter.ConvertByMht(mhtml);
     var outputFile = Path.Combine(AppSettings.ReportLocation, string.Format("{0}.doc", uniqueId));
     File.WriteAllBytes(outputFile, docData);
     return uniqueId;
 }