bobbynad Posted August 31, 2003 Posted August 31, 2003 Hello , Please let me know the procedure to write or change the contents of the textbox of the crystal report during runtime. If I have a textbox named Text1 in Section named Section7 & I need to change its contents during runtime , Whats the syntax to be used. Quote
pendragon Posted August 31, 2003 Posted August 31, 2003 Here's the code I use Dim otextObject As TextObject otextObject = crReportDocument.ReportDefinition.ReportObjects.Item("Text1") otextObject.Text = "New Text " Quote
jordiz Posted October 2, 2003 Posted October 2, 2003 Crystal Report at runtime Is there any way to produce a crystal report not based on a .rpt file, but from a runtime generated report, with different data depending on the source? For exemple, the user decides the inputs he wants on the report and it generates it: Customers table, "FirstName" and "LastName" fields, and only those appear... If I change tighten it SQL as I make to modernize the report? Thanks Quote
valric Posted November 1, 2003 Posted November 1, 2003 Try to use a parameter field. When the Report run the user will be prompt to key in data. Then you can filter the report with these date, as you mentioned aboved... valric.. Quote
krinpit Posted July 29, 2004 Posted July 29, 2004 Hi, I'm sorry for hijacking this thread, but it seems to be inactive and the topic is relevant to my question. My development Environment is VB.NET 2002 with the version of Crystal Reports that is bundled with VS.NET 2002. I want one of my reports to be blank ie: not dependant on any stored procedures or database tables etc. I believe that the way to do it is to drag a text object onto the blank report and somehow populate it at runtime (correct me if I'm wrong ;) ) I thought I had the answer from here: http://support.businessobjects.com/library/kbase/articles/c2014872.asp But I have reproduced the code in my form and the TextObject remains blank when I run it. I even changed the formatting of the TextObject to make sure that it is in place at runtime - it is Here is the code I have used: Private Sub frmCRUnbound_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim myReport As New CrystalReport2() Dim txtObj As TextObject txtObj = myReport.ReportDefinition.ReportObjects("txtTest") txtObj.Text = "Testing 123, Testing...." CrystalReportViewer1.ReportSource = myReport End Sub And, attached, is a screenshot of my output. Any Ideas as to why my text isn't appearing in my report :confused: Quote
krinpit Posted July 29, 2004 Posted July 29, 2004 (edited) I found the solution to this problem. It's a documented Crystal Reports bug. When you set the text of a textbox programmatically, the new value gets truncated to the length of the old. So, if the textbox was blank (zero-length) at design time it will look like nothing happened at all. Apparantly, the workaround is to use a formula field instead. Thanks to http://groups.google.ie/groups?hl=en&lr=&ie=UTF-8&newwindow=1&safe=off&threadm=u4yfkYT8BHA.2596%40tkmsftngp05&rnum=3&prev=/groups%3Fq%3DReportDefinition.ReportObjects(%2Btext%26hl%3Den%26lr%3D%26ie%3DUTF-8%26newwindow%3D1%26safe%3Doff%26selm%3Du4yfkYT8BHA.2596%2540tkmsftngp05%26rnum%3D3 for that one Edited July 29, 2004 by krinpit Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.