Jump to content


Photo

printing option for next sheet


  • Please log in to reply
7 replies to this topic

#1 mcblaise

mcblaise
  • Members
  • 3 posts

Posted 22 June 2009 - 02:11 AM

hi boki,

I recently purchased BERG components and have started to use it with my applications

It would add functionality to the NEXTSHEET if you could add printing capabilities.
Am on my final stage of writing an accounting software for a client when i discovered that the component has no print options.

this is my first time to use BERG components with my applications and with this suggested add on, you will make my life sooooo much easier

thanks for considering

manny constantino

#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 22 June 2009 - 04:34 PM

Hello,

There is no automated printing system inside NextSheet for now, but in next few days I will build one small demo for you to print NextSheet.

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#3 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 23 June 2009 - 11:28 PM

Hi mcblaise,

I will finish small demo tomorow. Please note that this demo will be only for rudimental printing.

Later, I will build much more better printing system.

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#4 mcblaise

mcblaise
  • Members
  • 3 posts

Posted 24 June 2009 - 07:33 AM

QUOTE (Boki (Berg) @ Jun 23 2009, 11:28 PM) <{POST_SNAPBACK}>
Hi mcblaise,

I will finish small demo tomorow. Please note that this demo will be only for rudimental printing.

Later, I will build much more better printing system.

Best regards


Hi boki,

I am really happy for this.... Thank you very very much... Looking forward to this biggrin.gif

God bless


#5 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 25 June 2009 - 08:13 PM

Hi mcblaise,

I have finish 1st version of Printing routine.

Add into public section of TNextSheet:

CODE
procedure TNextSheet.Print;


then, inside implementation add:

CODE
procedure TNextSheet.Print;
var
  i, j, X, Y, cw, ch, MapMode, PrevMapMode: Integer;
  CellRect: TRect;

  procedure PrintCell(R: TRect; Col, Row: Integer);
  begin
    Printer.Canvas.Font.Assign(Cell[Col, Row].Font);
    if Cell[Col, Row].Color <> clNone then
    begin
      Printer.Canvas.Brush.Color := Cell[Col, Row].Color;
      Printer.Canvas.FillRect(R);
    end;
    TGraphicsProvider.DrawWrapedTextRect(Printer.Canvas, R,
      GetAlignment(Cell[Col, Row].Alignment),
      GetVerticalAlignment(Cell[Col, Row].Alignment),
      False, Cell[Col, Row].DisplayText, BidiMode);
  end;

begin
  // Get previous map mode
  PrevMapMode := GetMapMode(Printer.Handle);
  // Set map mode to mm
  MapMode := MM_LOMETRIC;
  SetMapMode(Printer.Handle, MapMode);

  X := 0;
  Y := 0;

  Printer.BeginDoc;
  for i := 0 to Pred(RowCount) do
  begin
    for j := 0 to Pred(ColCount) do
    begin
      if Cell[j, i].Active then
      begin
        cw := GetCellWidth(j, i) * 10;
        ch := GetCellHeight(j, i) * 10;
        CellRect := Rect(X, Y, X + cw, Y + ch);
        PrintCell(CellRect, j, i);
      end;
      Inc(X, cw);
    end;
    X := 0;
    Inc(Y, ch);
  end;
  Printer.EndDoc;
  SetMapMode(Printer.Handle, PrevMapMode); { Turn back previous map mode }
end;


Now you may call NextSheet1.Print and sheet will be printed.

Please note that this is first version of printing routine. I am continue to work on it to add borders printing and multi-page printing.

I hope that you have some suggestions that I may implement.

Best regards and thank you for waiting.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#6 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 28 June 2009 - 12:48 AM

Hi mcblaise,

I have additionally modified procedure for printing, and if you may wait for few days more I may send you modified version.

I have write small article about using this procedure:

Next Sheet Printing

It will be very nice procedure and I only need to finish drawing borders.

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#7 mcblaise

mcblaise
  • Members
  • 3 posts

Posted 29 June 2009 - 07:07 AM

hi boki,

thanks very much.... ok.. i will wait... God bless

mcblaise



QUOTE (Boki (Berg) @ Jun 28 2009, 12:48 AM) <{POST_SNAPBACK}>
Hi mcblaise,

I have additionally modified procedure for printing, and if you may wait for few days more I may send you modified version.

I have write small article about using this procedure:

Next Sheet Printing

It will be very nice procedure and I only need to finish drawing borders.

Best regards



#8 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 30 June 2009 - 08:10 PM

Hello mcblaise,

I have upload pre-release version of NextSuite inside Members Section.

You may try new Print routine. Please note that routine is still in BETA stage and borders printing must be completed.

For details about how to use this new method, read this article

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users