Jump to content


Photo

NxGridPrint1


  • Please log in to reply
18 replies to this topic

#1 Dmitrii

Dmitrii
  • Members
  • 10 posts
  • Location:Belarus

Posted 16 April 2008 - 04:23 PM

Hello! Tell me please if it is possible to withdraw through NxGridPrint Footer? Sorry for my English!)

#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 16 April 2008 - 04:41 PM

Hello Dmitri,

At this moment it is not possible, but this feature will be added in near future.

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 Dmitrii

Dmitrii
  • Members
  • 10 posts
  • Location:Belarus

Posted 16 April 2008 - 04:48 PM

Thank you for a quick answer! Tell me, but as you can be updated, and how soon will feature added? Thank you very much!

#4 Dmitrii

Dmitrii
  • Members
  • 10 posts
  • Location:Belarus

Posted 17 April 2008 - 08:23 AM

And yet Export to HTML happening without closing <table> tag, and can be done so that you would Caption NextGrid be used as a cap at the press NextGrid. Best regards

#5 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 17 April 2008 - 06:59 PM

Hello Dmitrii,

I have fix </table> closing tag. Can you please tell me more details about 2nd question.

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.

#6 Dmitrii

Dmitrii
  • Members
  • 10 posts
  • Location:Belarus

Posted 18 April 2008 - 08:13 AM

When printing NextGrid, I want him to withdraw the title, it would propose to use the Caption.

#7 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 18 April 2008 - 10:30 PM

Hello Dmitry,

You probably want to set table's caption as NextGrid.Caption. If is this I may add it.

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.

#8 Dmitrii

Dmitrii
  • Members
  • 10 posts
  • Location:Belarus

Posted 19 April 2008 - 09:21 AM

Yes, I would like to use as the title of the table Caption output to the printer. And please tell me how soon will be updated, for me this is very important.

#9 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 19 April 2008 - 11:24 AM

Hello Please try to replace this function in NxCustomGridControl.pas:

CODE
procedure TNxCustomGridControl.SaveToHTML(const FileName: WideString);
var
    i, j: Integer;
  Html: TStringList;
  HtmlFile: TextFile;
  AlignStr: WideString;
  CellColor: TColor;
  C: string;
begin
  Html := TStringList.Create;
  Html.Add('<html><body>');
  Html.Add('<table width="100%" cellspacing="0" cellpading="1" border="1" style="border-collapse: collapse; border: 1px solid #666666">');
  Html.Add('<tr>');
  Html.Add('<caption>' + Caption + '</caption>');
  for i := 0 to Columns.Count - 1 do
      if Columns.PositionItem[i].Visible then
      begin
          Html.Add('<td bgcolor="#ffffff" width="' + IntToStr(Columns.PositionItem[i].Width) + '">');
          Html.Add('<font color="#000000" face="Verdana, Tahoma, Arial, Helvetica, sans-serif" style="font-size: 10px">');
            Html.Add('<b>');
        Html.Add(Columns.PositionItem[i].Header.Caption);
            Html.Add('</b>');
          Html.Add('</td>');
          Html.Add('</font>');
      end;
  Html.Add('</tr>');
  for j := 0 to RowCount - 1 do
  begin
      Html.Add('<tr>');
    for i := 0 to Columns.VisibleCount - 1 do
          if Columns.PositionItem[i].Visible then
        begin
            case Columns.PositionItem[i].Alignment of
            taLeftJustify: AlignStr := 'left';
            taCenter: AlignStr := 'center';
            taRightJustify: AlignStr := 'right';
          end;
        CellColor := GetCellColor(i, j);
        if CellColor = clNone then CellColor := clWindow;
        c := HTMLColorToString(CellColor);
          Html.Add('<td bgcolor="' + c + '" align="' + AlignStr + '" width="' + IntToStr(Columns.PositionItem[i].Width) + '">');
          Html.Add('<font color="#000000" face="Verdana, Tahoma, Arial, Helvetica, sans-serif" style="font-size: 10px">');
        case Columns.PositionItem[i].ColumnType of
          ctAutoInc: Html.Add(IntToStr(j + 1));
          else Html.Add(Cells[Columns.PositionItem[i].Index, j]);
        end;
          Html.Add('</td>');
          Html.Add('</font>');
        end;
          Html.Add('</tr>');
      end;
  Html.Add('</tr>');
  Html.Add('</table></body></html>');
  try
      AssignFile(HtmlFile, FileName);
    Rewrite(HtmlFile);
    Writeln(HtmlFile, Html.text);
  finally
    CloseFile(HtmlFile);
    Html.Free;
  end;
end;


I hope that it works now.

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.

#10 Dmitrii

Dmitrii
  • Members
  • 10 posts
  • Location:Belarus

Posted 21 April 2008 - 09:36 AM

I do not have the source code, only *.dcu (( please send me a file NxCustomGridControl.dcu

#11 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 21 April 2008 - 10:55 AM

Hello Dmitry,

New version will be out today anyway and you will be able to use new method.

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.

#12 Dmitrii

Dmitrii
  • Members
  • 10 posts
  • Location:Belarus

Posted 21 April 2008 - 11:08 AM

Thank you very much! Your components very helped me ! A printing Footer is added too? Thank you very much!

#13 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 21 April 2008 - 05:59 PM

Hello,

I will try to add a Footer too.

PS. Can you please read next topic about submisions of apps made by users with our componentns:
http://www.bergsoft....?showtopic=1910

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.

#14 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 21 April 2008 - 07:45 PM

Hello Dmitri,

I have completelly re-write SaveToHtmlFunction. Now it save xHtml + CSS file all by standard!

If you don't like attached style-sheet you may attach your own. Also, Formatings for number column are automatically applied too.

Here is how new look may be:
Attached File  table.gif   2.93KB   0 downloads

and html, much cleaner:

CODE
<html>
    <head>
        <title>Report</title>
        <link href="test_styles.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
        <table>
            <caption>Test Caption</caption>

            <tr>
                <th>First Name</th>
                <th>Salary</th>
            </tr>
            <tr>
                <td>Mike</td>
                <td class="salary">2,253.00</td>

            </tr>
            <tr>
                <td>Jack</td>
                <td class="salary">115.32</td>
            </tr>
            <tr>
                <td>Lisa</td>

                <td class="salary">0.00</td>
            </tr>
            <tr class="footer">
                <td>&nbsp;</td>
                <td>2,368.32    $</td>
            </tr>
        </table>
    </body>

<html>



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.

#15 Dmitrii

Dmitrii
  • Members
  • 10 posts
  • Location:Belarus

Posted 22 April 2008 - 08:49 AM

Hello dear Boki, I have one last question, I take free version, the upgrade is not available to me?
Best regards!

#16 Dmitrii

Dmitrii
  • Members
  • 10 posts
  • Location:Belarus

Posted 22 April 2008 - 09:22 AM

I am probably a little confused))) to 6 updated version is available, but not for 7. If the free update, look, you forgot to put the version 7))) Sincerely Dmitri.

#17 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 22 April 2008 - 10:24 AM

Hello Dmitry,

Version for Delphi 7 is also updated. Maybe you have try while I have upload files. I suggest trying once more.

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.

#18 Dmitrii

Dmitrii
  • Members
  • 10 posts
  • Location:Belarus

Posted 22 April 2008 - 11:54 AM

creates just css file:

NextGrid1.SaveToHtml (fname1, [hsSaveCaption, hsSaveFooter]);


What I missed?
Sorry, I find my bug))

#19 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 22 April 2008 - 01:11 PM

Hello,

Please add one more flag hsCreateHeaders. If this option is not set this give possibility to create whole page by own.

But in your case hsCreateHeaders need to be set.

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users