c# - Zipping multiple excel files -


i need multiple excel files (ssrs reports), put them in folder , zip it. how tried, it's not working:

public actionresult pricingreports( list<int> productids ) {     memorystream memstream = new memorystream();     using ( ziparchive archive = new ziparchive( memstream, ziparchivemode.update ) )     {         foreach ( int id in productids )         {             //preparing single excel file             reportmodel model = preparereportmodel( values );              _ssrs.getreport( model, "excel" );              ziparchiveentry singlereport = archive.createentry( "pricingreport" + " - " + id );             using ( binarywriter binwriter = new binarywriter( singlereport.open() ) )             {                 binwriter.write( model.reportbits );             }         }     }     return file( memstream.toarray(), system.net.mime.mediatypenames.application.octet, "pricing reports" ); } 


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

css - Can I use the :after pseudo-element on an input field? -