Draw Line using Code

edited June 2009 in FastReport .NET
Hello,every one. I need somebody's help.

The problem : I want to draw one line per 5 lines in the Data of the Group Header.frx which using in Demo.exe.

The Code I have wrote underline:
private void Data1_BeforePrint(object sender, EventArgs e)
{
int lien = ((Int32)Report.GetVariableValue("Row#"));
if(lien == 5)
{
// the last code is error!
//LineObject LineTemp = new LineObject();
//LineTemp.Draw(null);
}

Comments

  • edited 11:33AM
    Hello,

    The easier way is to put the line on a band in the designer and use the BeforePrint event to show/hide it:

    private void Data1_BeforePrint(object sender, EventArgs e)
    {
    int lien = ((Int32)Report.GetVariableValue("Row#"));
    Line1.Visible = lien % 5 == 0;
    }
  • edited June 2009
    Thank you AlexTZ!!! I have tested it OK.
    But I still want to know how to draw line in code.
    Could you tell me how to use "FastReport.LineObject.Draw(FRPaintEventArgs e)"?
    AlexTZ wrote: »
    Hello,

    The easier way is to put the line on a band in the designer and use the BeforePrint event to show/hide it:

    private void Data1_BeforePrint(object sender, EventArgs e)
    {
    int lien = ((Int32)Report.GetVariableValue("Row#"));
    Line1.Visible = lien % 5 == 0;
    }

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.