Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6347069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:08:19+00:00 2026-05-24T21:08:19+00:00

I am returning an html string as return value of a function. The return

  • 0

I am returning an html string as return value of a function. The return string is somewhat long (but nothing compared to limit of string datatype). But the returned string is getting truncated.

I tried to convert it to StringBuilder with no benefit.

P.S. My class is inside a .dll and I am trying to access it from outside,

What’s wrong and what should I do?

I am consuming here:

        string st = asso.getHtmlReport();

        FileStream fs = File.OpenWrite("file.html");

        StreamWriter sw = new StreamWriter(fs);

        sw.Write(st);

This is the string

        public string getHtmlReport()
    {
        string html = "<html><head><title>Association</title></head><body>" +
    "<table >" +
        "<tr align=\"left\">" +
        "<th>t</th>" +
        "<th>" + name1 + "</th>" +
        "<th>Avg rise</th>" +
        "<th>" + name2 + "</th>" +
        "<th>Avg rise</th>" +
        "<th>Difference</th>" +
        "<th>Direction</th>" +
        "</tr>" +
        "<tr>"+
        "<td style=\"padding-left:10px;padding-right:20px;\" valign=\"top\">" +
            seriesPrint(t) +
        "</td>" +
        "<td style=\"padding-left:10px;padding-right:20px;\" valign=\"top\">" +
            seriesPrint(series1) +
        "</td>" +
        "<td style=\"padding-left:10px;padding-right:20px;\" valign=\"top\">" +
            seriesPrint(avg1) +
        "</td>" +
        "<td style=\"padding-left:10px;padding-right:20px;\" valign=\"top>" +
            seriesPrint(series2) +
        "</td>" +
        "<td style=\"padding-left:10px;padding-right:20px;\" valign=\"top\">" +
            seriesPrint(avg2) +
        "</td>" +
        "<td style=\"padding-left:10px;padding-right:20px;\" valign=\"top\">" +
            seriesPrint(diff) +
        "</td>" +
        "<td style=\"padding-left:10px;padding-right:20px;\" valign=\"top\">" +
            seriesPrint(dir) +
        "</td>" +
        "</tr>"+ "</table>" +
    "<div style=\"padding:10px; position:absolute; right:0px; top:0px; width:300px; border:this solid black; background-color:Black; color:White;\">" +
        "<span style=\" font-weight:bolder; font-size: 2em; color: White;\">Results</span><br />" +
        "<span style=\" font-weight:bolder; font-size: 1em; color: White;\">Total records : " + series1.Length + "</span><br />" +
        "<span style=\" font-weight:bolder; font-size: 1em; color: White;\">Average error : " + avgError() + "</span><br />" +
        "<span style=\" font-weight:bolder; font-size: 1em; color: White;\">Together : " + support() + "</span><br />" +
        "<span style=\" font-weight:bolder; font-size: 1em; color: White;\">Opposite : " + (series1.Length - support()) + "</span><br />" +
    "</div>" +
"</body></html>";
        return html;

    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T21:08:21+00:00Added an answer on May 24, 2026 at 9:08 pm

    You need to flush your stream after you write it.

    sw.Flush();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Instead of returning a common string, is there a way to return classic objects?
I have a problem returning data back to the function I want it returned
It would appear that there is a size limit on the return value of
My cUrl call is returning HTML code like: &quot;Some stuff.&quot; and I'd like to
Returning to WinForms in VS2008 after a long time.. Tinkering with a OOD problem
Say instead of returning void a method you returned a reference to the class
I have a function runAjax that functions correctly. Unfortunately I am struggling to return
I wanted to create a function which would return the path of the current
I'm having an issue using Stripes validation method. It works but rather than returning
I have three resources: @RequestMapping(value = sample, method = RequestMethod.GET, headers = Accept=text/html) public

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.