arichika / RotativaCore

for ASP.NET Core on Azure Web Apps (by Windows). Support .NETStandard 2.0
https://www.nuget.org/packages/RotativaCore/
MIT License
14 stars 6 forks source link

viewaspdf does not inherit viewbag/viewdata #17

Open dineshk007 opened 1 year ago

dineshk007 commented 1 year ago

In addition to passing the model, is it possible to add viewdata as well. It will make it easier to support both online an pdf implementation of the code + compatible with other rotativa implementations.

arichika commented 1 year ago

~ other rotativa implementations.

I have no understanding of its usage. Is there a code to refer to?

dineshk007 commented 1 year ago

In MVC5, we were using https://github.com/webgio/Rotativa We were able to set properties in the viewbag and they were available in the view included with viewaspdf. We are switching to rotativacore as it seems to offer more than the mvc core version of webgio/rotativa,aspnetcore. we found that webgio viewaspdf can handle viewdata, but rotativacore viewaspdf doesn't. To make it work, we would need to make changes to use model rather than viewbag.

thanks.

arichika commented 1 year ago

@dineshk007
If so, then it would be best to use Rotativa's follow-on product. I don't know, I've never used it, but it is available at https://github.com/webgio/Rotativa.AspNetCore, etc.