# Blazor export file name

**URL:** <https://forum.radzen.com/t/blazor-export-file-name/18801>\
**Category:** Radzen Studio\
**Created:** [October 18, 2024, 3:42pm UTC](https://forum.radzen.com/t/blazor-export-file-name/18801 "2024-10-18T15:42:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![JUN](https://forum.radzen.com/letter_avatar_proxy/v4/letter/j/8e7dd6/32.png) [@JUN](https://forum.radzen.com/u/JUN)\
**Post date:** [October 18, 2024, 3:42pm UTC](https://forum.radzen.com/t/blazor-export-file-name/18801/1 "2024-10-18T15:42:59Z")

</div>

I have set the file name in the export event, but the format seems to be incorrect and it returns what appear to be the ASCII space characters also

 ![ExportName](https://forum.radzen.com/uploads/default/original/3X/5/4/54bf8afa205716261ad318604289435bfc1e2758.jpeg)

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [October 18, 2024, 4:01pm UTC](https://forum.radzen.com/t/blazor-export-file-name/18801/2 "2024-10-18T16:01:00Z")

</div>

Not sure what is export event and what format is incorrect. Check our forum FAQ on how to improve your post.

---

<div class="post-metadata">

**Author:** ![JUN](https://forum.radzen.com/letter_avatar_proxy/v4/letter/j/8e7dd6/32.png) [@JUN](https://forum.radzen.com/u/JUN)\
**Post date:** [October 18, 2024, 5:13pm UTC](https://forum.radzen.com/t/blazor-export-file-name/18801/3 "2024-10-18T17:13:44Z")

</div>

I hope this helps. I am creating a Blazor application and using the Click event in the BUTTON object, I have set the export name to Construction Data ${DateTime.Now} as shown here.

 ![ExportName1](https://forum.radzen.com/uploads/default/original/3X/c/c/cc52fbd2d16c4d222ad965313183c7940fa1cbb5.jpeg)

When the application is run and the export button is clicked, the file name shows up with ASCII space chararacters as shown here

 ![ExportName2](https://forum.radzen.com/uploads/default/original/3X/7/e/7e48dfc6586397e97a759297c453b3ba6a355659.jpeg)

The desired export name should be "Construction Data DD/MM/YYY hh:mm:ss

---

<div class="post-metadata">

**Author:** ![mumfie](https://forum.radzen.com/letter_avatar_proxy/v4/letter/m/b4bc9f/32.png) [@mumfie](https://forum.radzen.com/u/mumfie)\
**Post date:** [October 18, 2024, 5:52pm UTC](https://forum.radzen.com/t/blazor-export-file-name/18801/4 "2024-10-18T17:52:05Z")

</div>

You need to ensure that the characters are valid in a file name.  
For example on windows

 ![image](https://forum.radzen.com/uploads/default/original/3X/e/8/e87a5ac04463132f2d819870bb8e71abce96f4d8.png)

For instance you could use  
`$"Construction Data {DateTime.Now.ToString("yyyy-MM-dd--HH-mm-ss")}"`

---

<div class="post-metadata">

**Author:** ![JUN](https://forum.radzen.com/letter_avatar_proxy/v4/letter/j/8e7dd6/32.png) [@JUN](https://forum.radzen.com/u/JUN)\
**Post date:** [October 18, 2024, 6:37pm UTC](https://forum.radzen.com/t/blazor-export-file-name/18801/5 "2024-10-18T18:37:22Z")

</div>

Thank you mumfie, your recommendation worked and I was able to format the name correctly!

---

<div class="post-metadata">

**Author:** ![korchev](https://forum.radzen.com/user_avatar/forum.radzen.com/korchev/32/4_2.png) [@korchev](https://forum.radzen.com/u/korchev)\
**Post date:** [October 18, 2024, 6:37pm UTC](https://forum.radzen.com/t/blazor-export-file-name/18801/6 "2024-10-18T18:37:43Z")

</div>

The filename is passed as a query string parameter which encodes spaces as `%20`. If you must have spaces in the file name you should consider modifying the export controller implementation and replace the symbols - check the ToExcel method in ExportController.cs.
