Designer Saving Event passing wrong parameter
Designer Saving Event passing wrong parameter
When I hook the Designer's Saving Event to provide custom saving logic, it passes a StiSavingObjectEventArgs parameter which contains a member named "SaveAs" which is supposed to denote whether a user has press "Save" or "SaveAs".
Currently this Parameter's SaveAs member is always true on the ribbon interface no matter what gets used to Save a report design.
Currently this Parameter's SaveAs member is always true on the ribbon interface no matter what gets used to Save a report design.
Thanks,
John Hamilton
Hamilton & Company, LLC
John Hamilton
Hamilton & Company, LLC
Designer Saving Event passing wrong parameter
Hello John,
That is correct if you never save report and call Save command. In this case report designer call Save As command instead Save command.
Thank you.
That is correct if you never save report and call Save command. In this case report designer call Save As command instead Save command.
Thank you.
Designer Saving Event passing wrong parameter
I realized that but I cannot EVER get this parameter to return false. I have opened an already saved report and then selected "SAVE" (not "SAVE AS") and this parameter still remains true. As far as I can tell this parameter is not working correctly.
Thanks,
John Hamilton
Hamilton & Company, LLC
John Hamilton
Hamilton & Company, LLC
Designer Saving Event passing wrong parameter
Hello,
I have checked following code:
I have test it with Ribbon Gui and Standard Gui. All variants work fine. Can you provide sample project which reproduce this problem?
Thank you.
I have checked following code:
Code: Select all
StiOptions.Engine.GlobalEvents.SavingReportInDesigner += new StiSavingObjectEventHandler(GlobalEvents_SavingReportInDesigner);
void GlobalEvents_SavingReportInDesigner(object sender, StiSavingObjectEventArgs e)
{
MessageBox.Show("test");
}
Thank you.
Designer Saving Event passing wrong parameter
Try the following:
My problem is the I can never get it to trigger "Save Only".
Code: Select all
StiOptions.Engine.GlobalEvents.SavingReportInDesigner += new StiSavingObjectEventHandler(GlobalEvents_SavingReportInDesigner);
void GlobalEvents_SavingReportInDesigner(object sender, StiSavingObjectEventArgs e)
{
if (e.SaveAs)
{
MessageBox.Show("Save As");
}
else
{
MessageBox.Show("Save Only");
}
}
Thanks,
John Hamilton
Hamilton & Company, LLC
John Hamilton
Hamilton & Company, LLC
Designer Saving Event passing wrong parameter
:grinder: bump :grinder:
Thanks,
John Hamilton
Hamilton & Company, LLC
John Hamilton
Hamilton & Company, LLC
Designer Saving Event passing wrong parameter
Hello,
Problem detected. Please get build from 13 July. Also you can add following lines of code to event handler:
Thank you.
Problem detected. Please get build from 13 July. Also you can add following lines of code to event handler:
Code: Select all
StiDesignerControl designer = sender as StiDesignerControl;
designer.ReportNeverSaved = false;
Designer Saving Event passing wrong parameter
This is still not working for me.
I just need to know whether "Save As" or "Save" has been clicked. I really don't need any logic to decide whether I need to SaveAs. My save code can tell if the Report hasn't been saved and SaveAs still needs to be used.
This is how I envision it working. Set e.SaveAs depending on which menu item gets clicked "Save" or "Save As". Set ReportNeverSaved depending on whether the report actually has been saved or not. Then I can write logic like the following.
Currently I am testing this by loading a currently saved report out of my SQL Database using my custom loading logic and LoadReportFromString. Then I am changing the report and then clicking on "Save". It still sets e.SaveAs = true.
I just need to know whether "Save As" or "Save" has been clicked. I really don't need any logic to decide whether I need to SaveAs. My save code can tell if the Report hasn't been saved and SaveAs still needs to be used.
This is how I envision it working. Set e.SaveAs depending on which menu item gets clicked "Save" or "Save As". Set ReportNeverSaved depending on whether the report actually has been saved or not. Then I can write logic like the following.
Code: Select all
StiDesignerControl designer = sender as StiDesignerControl;
if (e.SaveAs || designer.ReportNeverSaved)
{
MessageBox.Show("Prompt for Filename Here");
}
else
{
MessageBox.Show("Save using current filename");
}
Thanks,
John Hamilton
Hamilton & Company, LLC
John Hamilton
Hamilton & Company, LLC
Designer Saving Event passing wrong parameter
Is there any help with this?
Thanks,
John Hamilton
Hamilton & Company, LLC
John Hamilton
Hamilton & Company, LLC
Designer Saving Event passing wrong parameter
Hello John,
Please use following static property - StiOptions.Designer.IgnoreOptionReportNewerSaved. Set it to true.
Thank you.
Please use following static property - StiOptions.Designer.IgnoreOptionReportNewerSaved. Set it to true.
Thank you.