Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

How to bold header when exporting csv

wonka1234
10 - Fireball

Hi,

 

Is there a way to bold the header row when exporting to csv?

 

Thanks.

4 REPLIES 4
PanPP
Alteryx Alumni (Retired)

Hi @wonka1234 

 

You can use the reporting tools (under the reporting category) to accomplish this.

 

Using the 'Table' tool in the Reporting tool pallet. Here are the steps:

 

1. Add the 'Table' tool to your canvas

2. Click on the "Default Table Settings" button on the bottom (in the configuration window)

3. Click on the header tab

4. Click the "B" 

5. You can then use a render tool to output a file of your choice.

 

 

boldheader.png

 

 

Hope this helps.

 

ShankerV
17 - Castor

Hi @wonka1234 

 

Please be informed that CSV doesnot allow any formatting like Bold, and other formatting.

https://stackoverflow.com/questions/3749020/how-to-bold-csv-data-in-excel

 

The only possibility is to use the Table tool (in Reporting palette) and you can output in the Excel format to keep the bold reflected in the output extracted.

 

Output:

ShankerV_0-1671504308902.png

 

ShankerV_1-1671504322819.png

 

Note: The workflow used to achieve the solution is attached which can be downloaded to see how the solution works.

 

If you believe your problem has been resolved. Please mark helpful answers as a solution so that future users with the same problem can find them more easily!!!!

 

Many thanks

Shanker V

 

ShankerV
17 - Castor

Hi @wonka1234 

 

Click the highlighted yellow.

 

ShankerV_0-1671504429148.png

 

ShankerV_1-1671504452575.png

 

The above setting, helps to Bold your heading.

 

Many thanks

Shanker V

rachelgomez
7 - Meteor

As others have already mentioned, a CSV is just text without formatting.

Since i'm assuming that you want the bold header in excel and you're exporting an ASP.NET GridView to a CSV file, there are two other options:

Render the GridView's HTML(a HTML-Table) with a bold header to a file, excel will interpret it correctly
Create a real excel file, i can recommend EPPlus warmly, here's a sample.
Sample for the first approach:

string attachment = "attachment; filename=Contacts.xls";
Response.ClearContent();
Response.AddHeader("content-disposition", attachment);
Response.ContentType = "application/ms-excel";
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
GridView1.RenderControl(htw);
Response.Write(sw.ToString());
Response.End();
If you run the code as above, it will result in an HttpException as follows:

Control 'GridView1' of type 'GridView' must be placed inside a form tag with runat=server."

To avoid this error, add the following code:

public override void VerifyRenderingInServerForm(Control control)
{
// yes, it's correct that this is empty
}

 

Regards,

Rachel Gomez

Labels
Top Solution Authors