Open Viewer with filled find topic
Open Viewer with filled find topic
Hello,
is it possible to open a report with viewer where the find toolbar is shown (CTRL +F) and the textbox with find topic is filled out already and the search is started? So i can have a searched report with highlighted lines at startup time.
Thanks and regards
Thorsten Pontow
is it possible to open a report with viewer where the find toolbar is shown (CTRL +F) and the textbox with find topic is filled out already and the search is started? So i can have a searched report with highlighted lines at startup time.
Thanks and regards
Thorsten Pontow
Thorsten Pontow
It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
Re: Open Viewer with filled find topic
Hello,
Please try to use the following code:
Thank you.
Please try to use the following code:
Code: Select all
viewerControl.Report = report;
viewerControl.IsFindActivated = true;
viewerControl.FindValue = "find value";
Re: Open Viewer with filled find topic
Hello Aleksey,
i'm doing the following now
but i does not work. The Find status bar is not shown all.
Do you have any other suggestions?
Thank you
Thorsten Pontow
i'm doing the following now
Code: Select all
StiViewerControl viewer = new StiViewerControl
{
Report = report,
IsFindActivated = true,
FindValue = "find value"
};
report.Compile();
viewer.Report.ShowWithWpfRibbonGUI();
Do you have any other suggestions?
Thank you
Thorsten Pontow
Thorsten Pontow
It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
Re: Open Viewer with filled find topic
Hello,
For WPF viewer is possible only show Find ToolBar:
Thank you.
For WPF viewer is possible only show Find ToolBar:
Code: Select all
report.Render();
StiWpfViewerControl viewer = new StiWpfViewerControl();
viewer.Report = report;
viewer.InvokeToolFindEnable();
Grid.Children.Add(viewer);
Re: Open Viewer with filled find topic
Hello Aleksey,
i found a solution at last. It cost me some time, nerve and effort. But now it works. When the report is opening i now have an already searched report in a WPFRibbonViewer with all found places highlighted. I needed to use some reflection but that's ok for me.
Here's the code:
A little bit tricky but so what! The end justifies the means.
Regards
Thorsten Pontow
i found a solution at last. It cost me some time, nerve and effort. But now it works. When the report is opening i now have an already searched report in a WPFRibbonViewer with all found places highlighted. I needed to use some reflection but that's ok for me.

Here's the code:
Code: Select all
report.Render();
report.ShowWithWpfRibbonGUI();
StiWpfRibbonViewerWindow viewerForm = StiGuiOptions.GetViewerFormWithRibbonGUI(report, StiGuiMode.Wpf) as StiWpfRibbonViewerWindow;
if (!ReferenceEquals(viewerForm, null))
{
Type viewerFormType = viewerForm.GetType();
FieldInfo viewerControlField = viewerFormType.GetField("viewerControl", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static);
if (!ReferenceEquals(viewerControlField, null))
{
StiWpfRibbonViewerControl viewerControl = (StiWpfRibbonViewerControl)viewerControlField.GetValue(viewerForm);
if (!ReferenceEquals(viewerControl, null))
{
Type viewerControlType = viewerControl.ViewerControl.GetType();
FieldInfo textboxFindField = viewerControlType.GetField("textBoxFind", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static);
if (!ReferenceEquals(textboxFindField, null))
{
TextBox textBoxFind = (TextBox)textboxFindField.GetValue(viewerControl.ViewerControl);
if (!ReferenceEquals(textBoxFind, null))
{
textBoxFind.Text = "Replace with your own SearchPhrase here";
viewerControl.ViewerControl.InvokeFind();
}
}
}
}
}
Regards
Thorsten Pontow
Thorsten Pontow
It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
Re: Open Viewer with filled find topic
Hello.
Thank you for posting this solution.
We are very glad to have such customers.
Thank you.
Thank you for posting this solution.
We are very glad to have such customers.
Thank you.