Page 2 of 2
Re: Export to txt > modify extension?
Posted: Fri Jan 29, 2016 12:37 pm
by Jennypi
Wow, it's working great, thank you so much!
I think I have everything that I need

Re: Export to txt > modify extension?
Posted: Fri Jan 29, 2016 1:04 pm
by HighAley
Hello.
We are always glad to help you.
Let us know if you need additional help.
Thank you.
Re: Export to txt > modify extension?
Posted: Fri Jan 29, 2016 1:34 pm
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
Re: Export to txt > modify extension?
Posted: Fri Jan 29, 2016 1:59 pm
by HighAley
Hello.
You should add additional check if Form1.DialogResult == DialogResult.OK.
Thank you.
Re: Export to txt > modify extension?
Posted: Fri Jan 29, 2016 2:57 pm
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.
Re: Export to txt > modify extension?
Posted: Mon Feb 01, 2016 7:55 am
by HighAley
Hello, Jenny.
Please, set the Format property DateTimePicker to Custom.
Thank you.
Re: Export to txt > modify extension?
Posted: Wed Aug 31, 2016 3:32 pm
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 (5.82 KiB) Viewed 4551 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);
}
Re: Export to txt > modify extension?
Posted: Thu Sep 01, 2016 8:33 am
by HighAley
Hello.
Please, try to set next options:
Code: Select all
Page1.UnlimitedBreakable = false;
Page1.UnlimitedHeight = true;
Thank you.
Re: Export to txt > modify extension?
Posted: Thu Sep 01, 2016 8:41 am
by Jennypi
Working perfectly, thank you so much!

Re: Export to txt > modify extension?
Posted: Thu Sep 01, 2016 9:29 am
by HighAley
Hello, Jennypi.
We are always grad to help you.
Let us know if you need our help you.
Thank you.