- Home
- Forum
- ASP.NET Core - EJ 2
- How to fix this error the using components are missing.
How to fix this error the using components are missing.
Hi i am developing PDF generator an AUTOTAG component and already done downloading nuget package Syncfusion.Blazor I dont know whats the next step can you help me?
Attachment: Screenshot_20210517_124821_9c27ab44.rar
sample pick below.
Attachment: Screenshot_20210517_124821_9c27ab44.rar
SIGN IN To post a reply.
3 Replies
1 reply marked as answer
GK
Gowthamraj Kumar
Syncfusion Team
May 18, 2021 09:27 AM UTC
Hi Leonardo,
Thank you for contacting Syncfusion support.
We can create a PDF document with auto tags in Blazor using PDF library. For this, we need to install Syncfusion.PDF.Net.Core NuGet package to the Blazor project. We have attached the simple sample for your reference. Kindly please try the sample on your end let us know the result.
Please refer the below links for more information,
Note: Run the application à Go to Fetch Dataà Click Export to PDF button to create PDF document.
Please let us know if you need any further assistance with this.
Regards,
Gowthamraj K
Marked as answer
Hi Leonardo,Thank you for contacting Syncfusion support.We can create a PDF document with auto tags in Blazor using PDF library. For this, we need to install Syncfusion.PDF.Net.Core NuGet package to the Blazor project. We have attached the simple sample for your reference. Kindly please try the sample on your end let us know the result.Please refer the below links for more information,Note: Run the application à Go to Fetch Dataà Click Export to PDF button to create PDF document.Please let us know if you need any further assistance with this.Regards,Gowthamraj K
Thank you very much for the feedback.
last question sir. the ExportService seems have given string data, but how do I add this weather data in PDF into ExportService.cs?
@page "/fetchdata"
@using BlazorApp1.Data
@inject WeatherForecastService ForecastService
@inject ExportService exportService
@inject Microsoft.JSInterop.IJSRuntime JS
@using System.IO;
<h1>Weather forecast</h1>
<p>This component demonstrates fetching data from a service.</p>
<button class="btn btn-primary" @onclick="@ExportToPdf">Export to PDF</button>
@functions
{
protected async Task ExportToPdf()
{
using (MemoryStream excelStream = ExportService.CreatePdf(forecasts))
{
await JS.SaveAs("Sample.pdf", excelStream.ToArray());
}
}
}
@if (forecasts == null)
{
<p><em>Loading...</em></p>
}
else
{
<table class="table">
<thead>
<tr>
<th>Date</th>
<th>Temp. (C)</th>
<th>Temp. (F)</th>
<th>Summary</th>
</tr>
</thead>
<tbody>
@foreach (var forecast in forecasts)
{
<tr>
<td>@forecast.Date.ToShortDateString()</td>
<td>@forecast.TemperatureC</td>
<td>@forecast.TemperatureF</td>
<td>@forecast.Summary</td>
</tr>
}
</tbody>
</table>
}
@code {
private WeatherForecast[] forecasts;
protected override async Task OnInitializedAsync()
{
forecasts = await ForecastService.GetForecastAsync(DateTime.Now);
}
}
GK
Gowthamraj Kumar
Syncfusion Team
May 20, 2021 11:28 AM UTC
Hi Leonardo,
Thank you for your update.
We can get the weather data and draw the data in a table format by using PdfGrid class. We have modified the sample to achieve your requirement, attached the sample and output document for your reference. Kindly please try the below sample on your end and let us know the result.
Sample: https://www.syncfusion.com/downloads/support/forum/165545/ze/BlazorApp1_WhetherData-936862288
Please refer to the below link for more information,
Please let us know if you need any further assistance with this.
Regards,
Gowthamraj K
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
- Marked answer
-
LE Leonardo
- May 17, 2021 05:18 AM UTC
- May 20, 2021 11:28 AM UTC