How to retrive TextBox Value After User Edit In Preview Mode
How to retrive TextBox Value After User Edit In Preview Mode
Please Help me
How to retrive TextBox Value After User Edit In Preview Mode
Thank you
How to retrive TextBox Value After User Edit In Preview Mode
Thank you
How to retrive TextBox Value After User Edit In Preview Mode
You can use following code:
Thank you.
Code: Select all
StiText text = report.RenderedPages[0].GetComponents()["Text1"] as StiText;
string value = text.Text.Value;
How to retrive TextBox Value After User Edit In Preview Mode
Great Thank...Vital wrote:You can use following code:
Thank you.Code: Select all
StiText text = report.RenderedPages[0].GetComponents()["Text1"] as StiText; string value = text.Text.Value;
How to retrive TextBox Value After User Edit In Preview Mode
Hi Vital.
This method works very well but I need something extra.
I need a way to get the original value of the StiText component using only the component returned by report.RenderedPages[0].GetComponents()["Text1"] as StiText;
Something along the lines of text.Text.OrinigalValue
The reason I need this is because my report consists of external subreports I have no way of knowing where that StiText came from, all I know is that it is editable.
I tried adding information to the StiText.Tag but the tag value is empty when I retrieve the StiText via the report.RenderedPages.
When I use report.GetComponents or report.CompiledReport.GetComponents the text.Tag contains a value.
Thank you :grinder:
This method works very well but I need something extra.
I need a way to get the original value of the StiText component using only the component returned by report.RenderedPages[0].GetComponents()["Text1"] as StiText;
Something along the lines of text.Text.OrinigalValue
The reason I need this is because my report consists of external subreports I have no way of knowing where that StiText came from, all I know is that it is editable.
I tried adding information to the StiText.Tag but the tag value is empty when I retrieve the StiText via the report.RenderedPages.
When I use report.GetComponents or report.CompiledReport.GetComponents the text.Tag contains a value.
Thank you :grinder:
How to retrive TextBox Value After User Edit In Preview Mode
Unfortunately we do not have such a property in the StiText component, but you can save all editable values using the following method of the StiReport class:
Then all these values can be retrieved with the method:
Thank you.
Code: Select all
SaveEditableFields(Stream stream)
Code: Select all
LoadEditableFields(Stream stream)
or
LoadEditableFields(string path)
Thank you.
How to retrive TextBox Value After User Edit In Preview Mode
Hi Edward.Edward wrote:Unfortunately we do not have such a property in the StiText component, but you can save all editable values using the following method of the StiReport class:
Then all these values can be retrieved with the method:Code: Select all
SaveEditableFields(Stream stream)
Code: Select all
LoadEditableFields(Stream stream) or LoadEditableFields(string path)
Thank you.
I had a look at the SaveEditableFields method and it does not give me enough information.
They way I am using the editable field is it loads data from a data field. Then the user can edit it and save it again. What makes it difficult is that I cannot just go save the original dataset, I have to pass the new values on to the business object and it will go update whatever is needed to save the new data.
If I can have the original source of that text eg. {CUSTOMER.NAME} and I now have the new value "John" I can go save the customer name.
This is just a simple example of what I do.
The following works if it does not have any subreports:
Code: Select all
Dim oldText As StiText = TryCast(pReport.GetComponentByName(t.Name), StiText)
Dim originalText As String
If oldText Is Nothing Then
originalText = ""
Else
originalText = oldText.Text.Value.Trim
End If
The problem is that once I have subreports i cannot use pReport.GetComponentByName(t.Name) any more. The text field does not come from this report and is not found.
I tried adding information into the Tag of the field but t.Tag.Value is always "" while oldText.Tag.Value contains the value I gave the field.
This is a very big problem for me at the moment and I will really appreciate it if you can do one of 2 things for me please:
1. Give me a way to access t.Text.OldValue (harder to do I realise but a lot better for my implementation)
2. Keep the value in t.Tag.Value when the report is rendered. (I hope this is easy)
Thanks!
How to retrive TextBox Value After User Edit In Preview Mode
I found a way to get the Tag value:
Code: Select all
Dim e As New Events.StiValueEventArgs
t.InvokeGetTag(Me, e)
tagText = CStr(e.Value)