November-06's Profile User Rating: *****

Reputation: 47 Craftsman
Group:
Active Members
Active Posts:
450 (0.27 per day)
Joined:
04-January 11
Profile Views:
17,302
Last Active:
User is offline Today, 01:20 AM
Currently:
Offline

Previous Fields

Country:
Who Cares
OS Preference:
Who Cares
Favorite Browser:
Who Cares
Favorite Processor:
Who Cares
Favorite Gaming Platform:
Who Cares
Your Car:
Who Cares
Dream Kudos:
0
Icon   November-06 has not set their status

Posts I've Made

  1. In Topic: Printing StringBuilder with HTML tags

    Posted 28 Jul 2015

    Thanks, guys. I have played around with Graphics and have successfully fulfilled my requirements. Thanks again.
  2. In Topic: Printing StringBuilder with HTML tags

    Posted 24 Jul 2015

    View PostSkydiver, on 23 July 2015 - 11:07 PM, said:

    Is that PrintDocument the version from WinForms? If so, you should just pass in the Graphics object from your printer to that API call.


    Yes, it is the PrintDocument from Windows Forms.

    Here's the code I am using. I've researched this through google.

     private static void printdoc_PrintPage(object sender, PrintPageEventArgs e)
            {
                float linesPerPage = 0;
                float yPos = 0;
                int count = 0;
                float leftMargin = e.MarginBounds.Left;
                float topMargin = e.MarginBounds.Top;
                string line = null;
    
                // Calculate the number of lines per page.
                linesPerPage = e.MarginBounds.Height / printFont.GetHeight(e.Graphics);
    
                // Print each line of the file. 
                while (count < linesPerPage && ((line = sreader.ReadLine()) != null))
                {
                    yPos = topMargin + (count * printFont.GetHeight(e.Graphics));
                    e.Graphics.DrawString(line, printFont, Brushes.Black, leftMargin, yPos, new StringFormat());
                    count++;
                }
    
                // If more lines exist, print another page. 
                if (line != null)
                    e.HasMorePages = true;
                else
                    e.HasMorePages = false;
            }
    
    


    What happens is that the whole HTML string is displayed in one line...

    <table><tr><th>header 1</th><th>header 2</th></tr><tr><td>cell 1.1</td><td>cell 2.1</td></tr></table>

    I haven't worked with Graphics before so I'm not sure how to do this. I'll do more research on this.

    If you know of a link that I can use as a reference, I'll be glad if you can share it.

    Thanks a lot.
  3. In Topic: Printing StringBuilder with HTML tags

    Posted 23 Jul 2015

    I am retrieving data from the database and building HTML tags with StringBuilder.

    This StringBuilder is being read into a MemoryStream then into a StreamReader so I can print it with Printdocument.

    The output, though, is printing the HTML string, <table><tr><th>column1</th></tr></table>. I need it to print in table format.

    I am thinking that maybe there's a workaround with Encoding but I'm still not sure.


    I don't know anything about PostScipt or PCL Library but I'll look into them. Thanks for the tip.
  4. In Topic: How to access field in another table within stored procedure

    Posted 30 May 2015

    You are not even including any column from the tables you are reading in your select statement. What's the point of all these querying?

    Then you are getting a column from a table that is not part of the tables you are querying on.

    You should rethink your objectives. What is your desired output? What are the tables concerned? What are the conditions that need to be considered? How can the desired output be achieved?

    Can't you just query directly to tblActivityCounts? Or, maybe, if possible, tblActivityCounts should be part of the tables being joined.
  5. In Topic: index was outside the bounds of the array

    Posted 30 May 2015

    Can you explain what you are trying to do? What is the purpose of the loop anyway?

    Why do you have two arrays? What is the purpose of each? Why are you looping through them to append to a StringBuilder?

    What are you trying to achieve?

    You should give us more details since your question is really vague.

My Information

Member Title:
D.I.C Regular
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:
Interests:
Programming, Playing Chess
Programming Languages:
C#.NET
VB.NET
ASP.NET
LINQ
VB 6.0
Java
C
MATLAB

Contact Information

E-mail:
Private
Yahoo:
Yahoo  sixth_of_november@yahoo.com

Comments

November-06 has no profile comments yet. Why not say hello?