Export to txt > modify extension?

Stimulsoft Reports.NET discussion
Jennypi
Posts: 361
Joined: Mon Nov 17, 2008 7:13 am
Location: France

Re: Export to txt > modify extension?

Post by Jennypi »

Wow, it's working great, thank you so much!
I think I have everything that I need :)
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Export to txt > modify extension?

Post by HighAley »

Hello.

We are always glad to help you.
Let us know if you need additional help.

Thank you.
Jennypi
Posts: 361
Joined: Mon Nov 17, 2008 7:13 am
Location: France

Re: Export to txt > modify extension?

Post by Jennypi »

A quick question to improve the report:
when clicking Cancel in the form, the Save dialog is still opening. Is there a way to avoid this?

Thanks
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Export to txt > modify extension?

Post by HighAley »

Hello.

You should add additional check if Form1.DialogResult == DialogResult.OK.

Thank you.
Jennypi
Posts: 361
Joined: Mon Nov 17, 2008 7:13 am
Location: France

Re: Export to txt > modify extension?

Post by Jennypi »

Thanks, it works :)

Code: Select all

if (Form1.DialogResult == DialogResult.OK)
{
SaveFileDialog sf = new SaveFileDialog();
sf.Title = "Save pathosis file";
sf.Filter = "Pathosis file (*.pathosis)|*.pathosis";
sf.FileName=ComboBoxControl1.Control.Text+"_"+Format("{0:yyyyMMdd}",Today);

var result = sf.ShowDialog();

if (result == System.Windows.Forms.DialogResult.OK)
{
FileStream fs = new FileStream(sf.FileName, FileMode.Create, FileAccess.Write);
this.ExportDocument(StiExportFormat.Text, fs, new StiTxtExportSettings() { PageRange = new StiPagesRange(1) });
    fs.Close();
}

this.RenderedPages.RemoveAt(1);
}
One more question :) How do I set a custom format in a form datepicker? I tried yyyyMMdd in Custom Format properties, but it's not working, I still see the full text date.

Thank you.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Export to txt > modify extension?

Post by HighAley »

Hello, Jenny.

Please, set the Format property DateTimePicker to Custom.

Thank you.
Jennypi
Posts: 361
Joined: Mon Nov 17, 2008 7:13 am
Location: France

Re: Export to txt > modify extension?

Post by Jennypi »

Hi,

I'm writing again in this topic to ask a new question.
In the report you designed for me, you set the height of "page to display" to unlimited.
The problem is that when we export such a file to Excel, there are blank rows in between pages:
Sans titre.png
Sans titre.png (5.82 KiB) Viewed 4543 times
So I set the "page to display" to "unlimited height=no", which fixed the excel blank row issue.

Now the problem is that the code that you gave me (see below) takes "StiPagesRange(1)" of the report. But sometimes StiPagesRange(1) is not the page that I want to save as the special extension. It's just the second page of the first report page. Would it be possible to take the last page of the report rendering, not the second one?
Do you see any other solution?

Thanks for your help!

Code: Select all

    if (Form1.DialogResult == DialogResult.OK)
    {
SaveFileDialog sf = new SaveFileDialog();
    sf.Title = "Save pathosis file";
    sf.Filter = "Pathosis file (*.pathosis)|*.pathosis";
    sf.FileName=ComboBoxControl1.Control.Text+"_"+Format("{0:yyyyMMdd}",Today);

var result = sf.ShowDialog();

    if (result == System.Windows.Forms.DialogResult.OK)
    {
FileStream fs = new FileStream(sf.FileName, FileMode.Create, FileAccess.Write);
this.ExportDocument(StiExportFormat.Text, fs, new StiTxtExportSettings() { PageRange = new StiPagesRange(1) });
        fs.Close();
    }

    this.RenderedPages.RemoveAt(1);
    }
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Export to txt > modify extension?

Post by HighAley »

Hello.

Please, try to set next options:

Code: Select all

Page1.UnlimitedBreakable = false;
Page1.UnlimitedHeight = true;
Thank you.
Jennypi
Posts: 361
Joined: Mon Nov 17, 2008 7:13 am
Location: France

Re: Export to txt > modify extension?

Post by Jennypi »

Working perfectly, thank you so much! :)
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Export to txt > modify extension?

Post by HighAley »

Hello, Jennypi.

We are always grad to help you.
Let us know if you need our help you.

Thank you.
Post Reply