How can i get the text object so that i can use it in formula editor?
Text objects cannot be read or changed using the Formula Editor within Crystal Reports. If you want dynamic content that I would suggest using a Formula instead of a Text Object.
Rather bizarrely, you are able change a Text Object value at runtime using .NET
e.g.
rptObject.ReportDefinition.ReportObjects("Text1").Text = "Some dynamic content"
Related
I want to add a chart inside a textbox using VBA in Microsoft word.
I have tried using
ActiveDocument.InlineShapes.AddChart()
API;
with cursor inside the textbox and still it doesn't produce the desired result
Unless you specify where the chart is to be placed it will simply be added to the document. If you had looked at the help text, IntelliSense or the Object Browser you would have seen that the method takes a Range as an argument. To place the chart in a specific location the range is required.
For example:
Set shp = ActiveDocument.InlineShapes.AddChart(Range:=Selection.Range)
Im completely lost on this, can I create a letter on a Report in visual basic then call a specific text from a textbox in another form or call a result from sql query cause printing is not an issue anymore on report or do I have to create a print button then generate the letter in there then call a specific text from a texbox in another form? If so how does the syntax goes?
I have a Microsoft Office 2013 Word template, in which I have some text-field elements, created by using Quick Parts -> Field -> MACROBUTTON noname [Type your text here].
If I fill only some of these fields (i.e. "[Name]", "[Address]") and I print or save as PDF, all the fields that I have not filled will display as [Insert your text here] in the printed paper or PDF. To be clear, the placeholder text must be manually removed (or replaced with the text you want).
I've readed somewhere, that you can create a macro, which will not display the placeholder text in the PFD- or printed version of the document, if there is no text written manually to that specific field (you leave it as it was). As this would be handy in cases, where you don't fill all the neccessery fields, my question is:
Q: Can this be achieved only by using Macro Button, and if not, what is needed to create text fields as described below that are not included in the printed or PDF saved version of the document?
This cannot be achieved without using actual macro code. Right now your solution contains no macro code, the fields simply function as "targets" and when the user types on the field it is deleted. Where the user does not type, the prompt remains. You'd need code to delete these fields from the document.
Given your requirement, the code would have to fire in the DocumentBeforeSave and the DocumentBeforePrint events. These events require a class and supporting code in a standard module. The basic information on how to set these up is in the Word object model language reference: https://msdn.microsoft.com/en-us/library/office/ff821218.aspx
An alternative to MacroButton fields would be to use ContentControls. But here, again, code and the same events would be required to remove/hide placeholder text.
I've been searching for a solution for this for quite some time now but with no luck.
I have a PDF that I am generating using VB.NET, the OpenOffice API and UNO. I am generating a text document and I need to be able to insert a checkbox in code.
One possible solution is to change the font to Wingdings and just type 'o' but that solution is neither elegant nor very easy to implement given my environment (using company created code for text document creation and manipulation, have a Write command that will write to the document (strings)).
If it's possible to just add the checkbox to a string of text then that would be perfect.
Have you tried to use an image of a checkbox (one checked and the other unchecked) and then inject that into your PDF, like this:
Caveat - I have worked with iTextSharp so the following code is relevant to iTextSharp, but the concept should translate to whatever PDF generating library/framework you are using
Method #1 - Put checkbox image into table cell
Dim imgCheckBoxChecked As Image = Image.GetInstance(HttpContext.Current.Server.MapPath("checkbox_checked.gif"))
Dim imgCheckBoxUnChecked As Image = Image.GetInstance(HttpContext.Current.Server.MapPath("checkbox_unchecked.gif"))
Dim table As Table
Dim cell As Cell
cell = New Cell(New Paragraph("", font))
'' Add checked or unchecked here
cell.AddElement(imgCheckBoxChecked)
cell.AddElement(imgCheckBoxUnChecked)
table.AddCell(cell)
Method #2 - Put checkbox image into the document
'' Add checked or unchecked here
pdfDoc.Add(imgCheckBoxChecked)
pdfDoc.Add(imgCheckBoxUnChecked)
Note: You will obviously need to find or create the .gif images for checked and unchecked.
I want to convert the text from Crystal reports to HTML and so far I have noticed that if I simply add a text field, I am able to change it to HTML by formatting text option and then under Paragraph tab there is an option to change the text interpretation. The problem is that I have entered text box to enter some hard coded information along with the database driven field, so I would like to know if there is a way I can convert the text box data into HTML. I am currently using crystal reports XI and want going forward want to upload these reports in a website using visual studio 2010. Thank you for your help.
It appears that the 'Text Interpretation' is ONLY a property of these fields:
Database
Formula
Parameter
Group Name
I wasn't able to get the Text Object to act as HTML.
However, you could create a formula with static HTML text:
"<strong>this is bold text</strong>"
Or a formula that combines text w/ data:
"<pre>" + {table.html_field} + "</pre>"
You could also use a string parameter to display user-supplied, HTML text.