How to populate RichTextBox from a saved value? - richtextbox

I have RichTextBox. I saved RichTextBox.Rtf on a database.
How I should I populate RichBoxText from the saved .Rtf value?
When move saved value to RichBoxText.Text - I see there all format codes.
When I use:
RichBoxText.Rtf.Insert(0, a.info_text) ;
all data disappears - only format codes are moved.
Thanks,
Zalek

OK, I found what a problem was.
I have a database where I saved some data as text from a TextBox.
Now I decided to convert my application to use RichTextBox instead of TextBox.
Each time a data was saved from a TextBox, I was getting a run time error trying to move it to RichTextBox.rtf. When saved data was from RichTextBox - it worked.
So what I need to do is to converts the database fields from text to .rtf format - I found examples on the web how to do it.
Problem solved.
Zalek

Related

Print Core Data Results To New Controller and Send To Email

* Edit * So my last question is, how to I get the data shown to be sent in email. I have done much HTML email in my other apps, but am confused as to what I am asking to look for / reference from core data and the proper formatting of code...
Using core date to populate UITable... all good... works as planned... (see pic 1) question... how can I get the result to format and and perhaps display as a UILabel on another controller similar to other results (see pic 2)... and then part two of my question... How can I get that result to print nicely in an email... I have used other code (not from coredata) to print and all works nicely together... I am stumped by the coredata portion...
In the result, you can see the math works out from core data, just don't know how to capture what the user typed in from core data (see pic 3)
Any help greatly appreciated...
EDIT (Clarification)...
I guess I want to show what the user has input into a new view controller and have it displayed in a readable format... (see image)...
Maybe my question is more... how to I PASS the data THAT THE USER CREATED from the Core Data Table Model to a new view controller and display the incoming text as a UILabel? (Can the new view controller be updated automatically? The user may add a new row, delete a row, change the hourly rate on an existing row, change a label etc. etc.. Once that is solved, I'd like to know how to send the results in an email so the end user can print for hard copy documentation... I have this scenario working in other apps, but they do not use core data...

EMS Advanced Data Export VCL - export to Excel with custom field names

I cant seem to figure this one out.
Exporting data to Excel works OK but I do not want to use the original table field names but ones of my choice.
Right now, the original field names get exported (with the data,of course). QExport4XLS1 is linked to the data-set. I tried to use qeCustomSource41 (custom source) and changing field names - it worked OK but no data got exported. Only the field names.
Does anyone know how to accomplish this ? I never used these components before, so I am just trying them out. The documentation is horrible.
It seems the only way to do this is through QExport4Dialog1 and not through QExport4XLS1.

Confirm multiply data before save

In my app I sometimes need to import some CSV data and I wanna get a view that is shown before save imported data to provide user possibility to check that data is correct. How to achieve it in Rails?
in the first form field, have a hidden field name "confirm" with value 0.
In the rails controller, if the confirm is 0 you just populate with the csv data, show the form again with confirm = 1
if the confirm is 1, then it means the csv was seen by the user, so you can save it.
bonus points-
Instead of showing the csv, make a textfield out of each csv cell- the user will be able to update the fields, not just check if the data is correct.

Saving / Retrieving DBGrid column settings: Columns.LoadFromStream and Columns.SaveToStream

I am actually after some ideas to how to address my problem below:
I have TCRTBGrid that users can move columns around and change the width. I want to save the setting in a database. I guess I can do this bit by using
Columns.LoadFromStream and Columns.SaveToStream
then store data in a blob field - Q: Can I store in a longtext field ?
but the biggest problem is that if new columns were added during design time after saving the column settings i want to append these new columns to the end.
Any suggestions ?
Thanks.
I did what Ravaut123 suggested and worked !!!!!!
Once retrieved the user setting , compared it with design grid manually for new and deleted fields 'cause that is only way I could think of.
Anyway thank you to both Ravaut123 and kobik.

Symfony will not populate a form with large string after bind()

I am having issues trying to override the value of a form field after submission. Currently the form includes a textarea and file upload input, but only one is used. If the user uploads a file it is parsed into text. I want to use the data that is parsed from the file as the value for the textare when the page reloads, rather than what was in the text box (empty). The content can not be determined until after the bind.
What I did was just bind the data again to manually set the value of the textarea after the document was parse. It works great if I hard code a value for the value, however when I use the full contents of the file, nothing is put in the textarea. There isn't some sort of length limit or something that could interfere with the population is there? I have tried short strings and they work fine, but these files are about 4k in length and won't populate in the text area.
Works
$this->form->bind(array('text'=>'1234'), $request->getFiles('profile_generate') );
Does not work, even though the value text is actually being set.
$this->form->bind(array('text'=>$largeString), $request->getFiles('profile_generate') );
FIX:
I suppose whatever function that Symfony uses to populate the fields from the bind() values has a problem with non-standard characters. Unfortunately it does not complain about it or let on to what the issue really is. After cleaning up the data, it worked fine.
$largeString = preg_replace('/[^(\x20-\x7F)\x0A]+/',' ', $largeString);
$this->form->bind(array('text'=>$largeString), $request->getFiles('profile_generate') );

Resources