Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: How to suppress a Column having System.Byte[] data Post Reply Post New Topic
Author Message
btough
Newbie
Newbie
Avatar

Joined: 14 May 2009
Online Status: Offline
Posts: 30
Quote btough Replybullet Topic: How to suppress a Column having System.Byte[] data
     Posted: 08 Jun 2009 at 3:16am
I created a Windows Form application. I am using Crystal Report to show the report. I create a DataSet, set this dataset as the DataSource to the Crystal Report and display the record from DataSet object into Crystal Report.
    My report contain 8 columns. out of that 2 columns displays binary data (i.e. images) from the dataset. The Type of these 2 columns is System.Byte[]. Current requirement is that, I have to provide option for these columns to user, so that if user want both or any one of these column, he will select option accordingly and I need to display the selected column.
     To acheive this target, I created dataset object with DataColumn1, DataColumn2 like columns, and build query to get the result as per these column names. So my question is how can I suppress the System.Byte[] datatype column at run time? also how can I change the text or name of the Columns to match the description of my columns?

I tried with 
 

rptDoc.ReportDefinition.Sections[

"Section2"].ReportObjects["Text7"].ObjectFormat.EnableSuppress = true;


But it is giving error as "The report field type is not valid"

     Please help if knows the solution?

Thanks in advance.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 08 Jun 2009 at 6:31am
Suppression would be via a formula.  I create a second table in my dataset that is the parameters selected.  Using this you could suppress the data.  You could also pass in the the column description, or it could be via another formula based on the parameters.
 
I do most of my report programming in the report.  I am sure that it can be done programatically, but Crystal seems to be awfully particular.
 
HTH
IP IP Logged
btough
Newbie
Newbie
Avatar

Joined: 14 May 2009
Online Status: Offline
Posts: 30
Quote btough Replybullet Posted: 08 Jun 2009 at 8:17am
Thank you lockwelle,
 
   Column hide/show will be depend on the user. I am not very expert in Crystal Report. I don't know how to access the Formula in C# code and pass the parameter to it or how to hide column using it.
   Any help will be appreciated.
 
Thank you.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 08 Jun 2009 at 8:27am
don't do it from C#, go into the report.  You need to do that anyway to format the report.  Just take care of the formatting there.
 
Crystal is not very dynamic, it is all based on how you layout your report.  Once that is decided, it is fairly inflexible to changes.
IP IP Logged
btough
Newbie
Newbie
Avatar

Joined: 14 May 2009
Online Status: Offline
Posts: 30
Quote btough Replybullet Posted: 17 Jun 2009 at 2:17am
Thank you lockwelle
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum